c++

ODBC and NLS_LANG

Let's say that I've created two different program executables, e.g. in C++. For some reason, the two programs internals representation of text are different from each other. Let's say the first program is using text representation A and the other text representation B. It could be a specific 8-bit ANSI codepage, Unicode/UTF-8 or Unicode...

setting value of string& to string

Hi, I have a string& parameter, and i want to assign it to string parameter. How can it be done. ...

VS 2010 C++ unable to load references due to out of date version number

When I set references for a C++ project in Visual Studio 2010, it fails to load a reference dll from another c# project because of a version mismatch. Building a C# project that references another c# project is no issue for me. I tried hard coding the version number for the c# project which worked great, but that was simply for testing a...

Handles and pointer to object

I have a python Interpreter written in C++, the PyRun_String function from the Python API is said to return a handle, however in my code I have it assigned to pointer to a PyObject? PyObject* presult = PyRun_String(code, parse_mode, dict, dict); Is this actually correct? Can you implicitly cast this handle to this object pointer? S...

Linker options to statically link a lib*.a file while creating a shared object

How can I tell the linker that statically link libfoo.a while building the shared object sharedobj.so using gcc/make. I have tried to pass the LDFLAG options LDFLAGS += -W1 --whole-archive -L/path/to/libfoo -lfoo I have also tried to pass LDFLAGS the options LDFLAGS += -W1, static -L/path/to/libfoo -lfoo I have also tried to pass LD...

C++: Where can I define the body for a private function?

Hi, I have a header like this (header guards not shown): class GameSystem { public: GameSystem(Game *pcGame); virtual ~GameSystem(); void Setup(); private: void InitGame(); void RunGame(); void ExitGame(); Game *m_pcGame; /* Properties */ int m_nWidth; int m_nHeight; int m_nFps; bool m_b...

Help with Arduino and Analog Min Max settings

Hey there, I have the following code: sVal = analogRead(potPin); // read the value from the sensor valMin = min(sVal, 1); valMax = max(sVal, 128); constrain(sVal,valMin,valMax); itoa(sVal, res, 10); println(res); println(" "); delay(150); clearScreen(); Now for some reason, the output on the gLCD screen is almost...

Open source soft modem that runs on Linux?

Can anyone recommend an open source soft modem (a software only emulation of a modem card), that runs on Linux? Preferably, this will be implemented in C/C++ ...

Changing number precision

How would you change the precision of a number for example: float n = 1.2345 and store it back to the variable 'n' with changing it to 1.23 ? ...

C++ / Java: Toggle boolean statement?

Hi, Is there a short way to toggle a boolean? With integers we can do operations like this: int i = 4; i *= 4; // equals 16 /* Which is equivalent to */ i = i * 4; So is there also something for booleans (like the *= operator for ints)? In C++: bool booleanWithAVeryLongName = true; booleanWithAVeryLongName = !booleanWithAVeryLongN...

C++ vtable resolving with virtual inheritance

I was curious about C++ and virtual inheritance - in particular, the way that vtable conflicts are resolved between bass and child classes. I won't pretend to understand the specifics on how they work, but what I've gleamed so far is that their is a small delay caused by using virtual functions due to that resolution. My question then is...

question on arrays in c++

int java declaration of array like this int a[][]=new int[3][3] works but in c++ not why? please help me i have not used c++ a long time so please help me ...

no appropriate default constructor available . (when creating a child class)

I am creating some custom exception classes doing the following class GXException { public: GXException(LPCWSTR pTxt):pReason(pTxt){}; LPCWSTR pReason; }; class GXVideoException : GXException { public: GXVideoException(LPCWSTR pTxt):pReason(pTxt){}; LPCWSTR pReason; }; When I created GXVideoException to extend GXExcep...

ITASK API for Windows Scheduler

Does anybody know what permissions are needed to create ITASK? This is the error I am getting in C++: Error creating ITask. Error: -2147024891 ...

C++ Function Calling Itself

Question I wish to know if this is a viable way to implement variable depth recursion so that I can run a function at each step and any better/other solutions to the description problem. Description Suppose I wish to have a function that fills an array either in pattern x,y,x,y,x,ywhere x and y are variables defined by some algorithm and...

Qt, How do I change the text color of one item of a QComboBox? (C++)

Hi, I cannot figure out how to change the text color of one particular item of a QComboBox. I was able to change the Background color of an item: comboBox->setItemData(i, Qt::green, Qt::BackgroundRole); (Qt::ForegroundRole had no effect at all, Qt 4.6, Ubuntu 10.04) and I was able to change the text color of all items with a styleshee...

Unexpected termination when pushing a shared_ptr into a list

I have some function: void addNormalLine(int id, LineNumber number, Rate smsRate, Rate callRate) { list<Account>::iterator iAccounts; findAccount(iAccounts, id); if(iAccounts == listOfAccounts.end()){ throw "AccountDoesNotExist"; } if(lineExists(number)){ throw "LineExists"; } else...

Is there an open source netflow collector C++ library set?

I am looking for a C++ library set to develop my own C++ daemon in Linux for collecting NetFlow information. Does anyone know of an open source one or a library set that is available? Many thanks ...

Video display with openGL

I want to display very high resolution video directly with OpenGL. The image data is going to be processed on the GPU and I want to avoid a round-trip back to the PC to show the video in a standard bitmap based window. Cross platform is nice, Windows only would be OK (so would nvidia only) Anyone have any links to ways doing this? ...

C++ Generate and store the co-ordinates of an n-cube

I want to write a function to generate and store the co-ordinates of an n-cube and I have no idea how to start. Specifically, I wish to generate the co-ordinates for an evenly or randomly distributed cloud of points for this n-cube and store them. What would be a good way to start with this or if possible, a quick solution? ...