No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hi I am trying to write "at" commands to serail port and send sms. `smsPort->Write("at"); // smsport type is System::IO::Ports::SerialPort ^smsPort;` gives me output OK At the end(after the writing message) I need to write ctrl+z smsPort->Write("Message"); smsPort->Write((char)26); this gives me error *'void System::IO::Ports::SerialPort::Write(System::String ^)' : cannot convert parameter 1 … |
|
Hi I came accross a code and i din't understand it Template.h [CODE] #define FRIEND_NEW template<class T> friend inline T* ::safe_new(const char*,int); template<typename T> inline T* safe_new0(const char* file, int line) { T* ptr = new T(); return ptr; };[/CODE] A.h [CODE] #include "Template.h" class A { FRIEND_NEW protected: A(); … |
|
Hello This is my base [CODE]class BaseClass { // base has no body };[/CODE] and child [CODE]class ChildClass : public BaseClass { public: void testMethod(); };[/CODE] I do [CODE]BaseClass* base = new BaseClass(); ChildClass* c = static_cast<ChildClass*>(base); c->testMethod();[/CODE] Above compile and ChildClass::testMethod() executes fine. my memory is allocated by BaseClass … |
|
Hello Is this safe? In a API I am using have a protected inheritance of a class [CODE] class B { public : method(); } class C : protected Class B { }[/CODE] I need to access those pulbic methods in Class B So is this ok and safe? [CODE]C* … |
|
Hello I am in a difficulty in finding the size of array. In following program I am passing the arraysize and the array as a parameters. Instead of doing that can I find the array size in the method? [CODE]template <class T, typename ReturnType = float> class TEnterImp { public: … |
|
Hi I have a third party code. [CODE]class Lazy { protected: template <class T> static void create( T*& ptr ) { ptr = new T; } }; template < class ClassT, class Policy=Lazy > class MakeT : private Policy { public: static ClassT* instance() { static ClassT* ptr = 0; … |
|
Hello In java I could keep static arrays like following. class Test { public static int myArray[10]; } Those arrays are static for any class. In C++ how could we do this? |
|
Hello I am in a question of assigning local scope pointers to global scope pinters. I have a code like this. [CODE]public : char* myValue; void process(TiXmlElement *element) { myValue= element->getText(); }[/CODE] But once the process function is returned value is garbage. So I did this. [CODE]public : char* myValue; … |
|
Hello I am confused with an error saying. [QUOTE]Error 1 error C2664: 'const char *TiXmlElement::Attribute(const char *) const' : cannot convert parameter 1 from 'char *(__cdecl *)(void)' to 'const char *' c:\GameProject\TheGameProject\ContentManager\src\NodeWater.cpp 38 [/QUOTE] I have a method that returns a const char* as follows [CODE]class XMLNodeNames { public: static … |
|
Hi I have a loop looping through an "band" object array. I am assigning a anonymous functions for the object property(actually dragging) [CODE]for (var j=0;j<5;j++) { var othis = this.bands[j]; othis.onDragstart = (function() {return othis.onDragstartResizeHandle()}); }[/CODE] onDragstartResizeHandle function [CODE]band.prototype.onDragstartResizeHandle = function() { alert(this.id); }[/CODE] when I drag a band it … |
|
Hi I have a class page.js page.js ------- [CODE]var band = null; for(var i=0; i<=10; i++) { band = new Band( 100, 100); band.onDragstart = function() { alert(i); }; }[/CODE] each time ondragstart triggers this prints the value 10 for all band objects. if i need to print 0,1,2,3...10 what … |