c++

error C2065: 'CoInitializeEx' : undeclared identifier

Hi, I get the following error while trying to use hres = CoInitializeEx(0, COINIT_MULTITHREADED); error C2065: 'CoInitializeEx' : undeclared identifier I have already included: #define _WIN32_DCOM #include <iostream> using namespace std; #include <comdef.h> #include <Wbemidl.h> in my cpp file. Kindly help. Thanks, Neha ...

How to capture high resolution image on Windows Mobile

Hi, I would like to capture high resolution image with Windows Mobile device. I've tried the example from WM SDK, but it captures just a single frame of video camera and the resolution is poor. Has anyone any experience with image capturing on Pocket PC with C++? Thanks ...

Why does C++ not have reflection?

This is a somewhat bizarre question. My objectives are to understand the language design decision and to identify the possibilities of reflection in C++. Why C++ language committee did not go towards implementing reflection in the language? Is reflection too difficult in a language that does not run on a virtual machine (like java)? If...

Static variables not being initialized - sometimes?

I have a game with puzzles. Puzzles are created from script files using a puzzle engine ID. Puzzle engines register themselves using a static variable in a static hash. I'm having reports of crashes and we've tracked down the problem to the hash not having certain keys, which should have been added by the static functions. Note that thi...

Special Meaning for Pointer Value 0x7c7c7c7c

While debugging a Linux app, I found a pointer with the suspicious value 0x7c7c7c7c. Does that particular value indicate anything? (I ask because I know from my MSVC days that in a debug build, values like 0xcdcdcdcd or 0xdddddddd would be stored into heap blocks that were uninitialized, freed, or otherwise invalid. Some people use ma...

How can I get the value data out of an MSXML::IXMLDOMElement

I have an xml string <grandparent> <parent> <child>dave</child> <child>laurie</child> <child>gabrielle</child> </parent> </grandparrent> What I want to get is the data raw xml that's inside the parent. I'm using MSXML iXMLElm->get_xml(&bStr); is returning <parent> <child>dave</child> <child>laur...

Default file extension of the executable created by g++ under Cygwin vs Linux.

Hi All, I've done most of my work on VisualStudio and don't have much experience with gcc or g++. When I tried to compile a (ex. aprogram.cpp) this morning on my pc using cygwin, I got (aprogram.exe) when I tried to compile the same thing on my Ubuntu box I got (aprogram) w/o any extension. I am just wondering if someone be kind enough ...

Symbian C++ - S60 application launches through TRK and Carbide, but not afterwards or when downloaded.

My application has just started exhibiting strange behaviour. I can boot it through the Carbide Debugger (using TRK) and it works fine with no visible errors and is left installed on the device. Any further attempts to launch the application fail, even after a restart. Uninstalling and downloading the .sisx file manually also doesn't w...

How to duplicate socket for target process under different user

I've hit upon a problem with WSADuplicateSocket, which I'm using to duplicate a socket for use by a different process. It works find when both processes are running under the same Windows user, but fails with error code 10022 (WSAEINVAL) when they are running under different users. Specifically, the process calling WSADuplicateSocket is...

Which C++ signals/slots library should I choose?

I want to use a signals/slots library in a project that doesn't use QT. I have pretty basic requirements: Connect two functions with any number of parameters. Signals can be connected to multiple slots. Manual disconnection of signal/slot connection. Decent performance - the application is frame-based (e.g. not event-based) and I want...

S60 application - Symbian C++ - Exit button doesn't work

Hi In my Symbian S60 application, my Options menu works as expected. But the Exit button does nothing. I am developing with Carbide and have used the UI Designer to add items to the options menu. Does anyone know how to enable the exit button, or why else it might not work? Thanks! ...

Native C++ SQL Framework

I need a high performance framework in native C++ for SQL. I need it to be able to use MySQL, Oracle and Microsoft SQL Server and provide abstraction from the lower level problems/idiosyncrasies found in every different syntax required for by DBMS from different vendors. Something like LINQ for C# and VB .Net. ...

2d array error c++

I'm trying to run a c++ 2d array (pretty simple file) and it works but an error (at least I think it's an error) appears on the end. The code for the array is; int myArray[10][10]; for (int i = 0; i <= 9; ++i){ for (int t = 0; t <=9; ++t){ myArray[i][t] = i+t; //This will give each element a value } } for (int i = 0; i <= 9; +...

SFTP C++ library?

Can anyone recommend a decent SFTP library for use with Windows C++ apps? If a cross-platform one is available then all the better, but it's not essential. It's for use with a commercial application, so paying for something isn't an issue. I am using the superb Ultimate TCP/IP library which supports FTP-S but not SFTP (yeh, I know, co...

C#/Java programmer learning C++ again. Project file structure?

As the question states, i am a C#/Java programmer who is interested in (re)learning C++. As you know C#/Java have a somewhat strict project file structure (especially Java). I find this structure to be very helpful and was wondering if it is a) good practice to do a similar structure in a C++, b) if so, what is the best way to setup it u...

c++ 3d arrays

I'm trying to run a 3d array but the code just crashes in windows when i run it, here's my code; #include <iostream> using namespace std; int main(){ int myArray[10][10][10]; for (int i = 0; i <= 9; ++i){ for (int t = 0; t <=9; ++t){ for (int x = 0; x <= 9; ++t){ myArray[i][t][x] = i+t...

Frame accurate synchronizing of subtitle files with MPEG video using DirectShow

This is a problem I have been dealing with for a while, and haven't been able to get a good answer (even from Microsoft). I'm using the generic dump filter to write hardware compressed MPEG files out to disk. In the graph, I also have a SampleGrabber filter that gets called on every frame. From the SampleGrabber callback, I get a subt...

What is the preferred naming conventions du jour for c++?

I am quite confused by looking at the boost library, and stl, and then looking at people's examples. It seems that capitalized type names are interspersed with all lowercase, separated by underscores. What exactly is the way things should be done these days? I know the .NET world has their own set of conventions, but it appears to be co...

C++ developing a GUI - classes?

I do have to say I'm fairly inexperienced when it comes to C++, don't be too harsh on me. Recently stumbled unto the wonders of the win32 API and have chosen to practice using it (I'd rather not use MFC/wxWidgets/etc at this point, just for educational purposes). Well, my real question is: How do you properly code your win32 GUI stuff ...

initializing std::string from char* without copy

I have a situation where I need to process large (many GB's) amounts of data as such: build a large string by appending many smaller (C char*) strings trim the string convert the string into a C++ const std::string for processing (read only) repeat The data in each iteration are independent. My question is, I'd like to minimise (if ...