c++

Is there a WinXP/WinXP Embedded API to change Locale (specifically, IME)?

I am looking for an API on WinXP to switch between installed IME's. The scenario is, to be able to plug in a langauge keyboard (say Spanish) and change the IME by clicking on a UI button (say button named Spanish) e.g. I plug in a Spanish keyboard and click on the UI button named Spanish. This should internally change the IME to Spanis...

Efficiently convert between Hex, Binary, and Decimal in C/C++

I have 3 base representations for positive integer numbers: Decimal, in unsigned long variable (e.g. unsigned long int NumDec = 200). Hex, in string variable (e.g. string NumHex = "C8") Binary, in string variable (e.g. string NumBin = "11001000") I want to be able to convert between numbers in all 3 representations in the most effici...

How do I disable exp/lib generation when building an exe?

I realize this is probably caused by some _dllexport() somewhere, not in my code but in some third-party piece. (Qt, Boost, OpenSG, ...) Is there a simple linker option to disable this? I've searched but not found anywhere. ...

how to call java function from c++?

Hello all how can i call java function from c++ application ( not using cmd methods.. ) Thanks ...

Open Source MFC Addins

Does anyone know of any websites that feature open source MFC addins for things around UI? ...

Win API for changing input language programatically

Hi, I want to change the input language in WinXP to Spanish, programatically. Is there an API to suport that? Thanks ...

PID from socket number on Windows?

I need to count amount of bytes sent and received from the network by various applications. First I thought about using LSP, but there is a lot of applications that do not use LSP at all (SMB for example). This is why I have written a small sniffer. This application works on IP level and collects data using recvfrom. So I have address...

DuplicateHandle(), use in first or second process?

The Windows API DuplicateHandle() http://msdn.microsoft.com/en-us/library/ms724251(VS.85).aspx Requires the Object handle to be duplicated and a handle to both the original process AND the other process that you want to use the duplicated handle in. I am assuming that if I have two UNRELATED processes, I could call DuplicateHandle() in...

The future of C++ Builder

A few years ago C++ Builder from Borland with its excellent VCL gui library and its gui designer was the best IDE for C++ development on Windows. Once beloved, for a couple of years now Builder has been losing users steadily. What do you think are the biggest mistakes Borland/Inprise/CodeGear/Embarcadero has made? ...

How to start writing a music visualizer in C++?

Hi, I'm interested in learning to use OpenGL and I had the idea of writing a music visualizer. Can anyone give me some pointers of what elements I'll need and how I should go about learning to do this? ...

Which IDE does Google use for C++ and Java development

I am curious which IDE does Google use for C++ and Java development? ...

How to automatically insert preprocessor and comment blocks into a new C++ header file in Visual Studio?

When I create a new C/C++ header file in Visual Studio (2005/2008), I want to have some preprocessor header includes automatically inserted into the new header file. Anybody know how to do this? The New Porject and New Item template system in Visual Studio does not seem to apply to C++ files. As an example, when I create foo.h, I want t...

New to C++: should I use Visual Studio?

I'm about to start work on my first C++ project. I've done lots of C# and VB (VB6 and VB.NET), plus Java and a few other things over the past 10 years or so, just never had a requirement for C++ until now. I plan to use Visual Studio 2008, but I'm interested to find out from experienced C++ programmers whether Visual Studio is a good ID...

C++ Thread-Safe Map

Does anyone know where I can find an implimentation that wraps an STL map and makes it thread safe? When I say thread safe I mean that it offers only serial access to the map, one thread at a time. Optimally, this map should use only STL and or boost constructs. ...

Is there a Perl script to implement C++ Class get/set member functions?

Hi, I was reading this morning the book The Pragmatic Programmer Chapter 3 on Basic Tools every programmer should have and they mentioned Code Generation Tools. They mentioned one Perl script for C++ programs which helped automate the process of implementing the get/set() member functions for private data members. Does anyone know abou...

'mpirun' is not recognized as an internal ort external commands,...

Hi all, I need to make a small openMP project. I took the example from the www.openmp.org. I can compile it with /openmp option within VC++ 2005. But, When I try to run the program, I am facing the "'mpirun' is not recognized as an internal ort external commands, operable program or batch file" error. When I search the net. I found this...

input from txt file to arrays

I have a text file with a line like: James Dean 10 Automotive 27010.43 and I need to read that file and put each of the 4 above into arrays. char nameArray[MAX][NAME_MAX]; int yearArray[MAX]; char departmentArray[MAX][DEP_MAX]; double payArray[MAX]; while(i < MAX && infile) { infile.getline(nameArray[i], 20); ...

RegOpenKeyEx fails on HKEY_LOCAL_MACHINE

Hi I'm trying to read a registry value that gives me the path to firefox.exe. This is stored under HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox 3.0.10\bin (the version number can be found somewhere else) But I cant seem to get RegOpenKeyEx to return ERROR_SUCCESS for anything under HKEY_LOCAL_MACHINE so this test fails: if...

Determining whether an object is in a std::set

I'm trying to determine whether an object is already contained within a std::set. According to msdn (and other sources) the set::find function is supposed to return end() if it doesn't find the element you asked for. However when I implement code like the following, set::find returns junk (0xbaadf00d) instead. set<Cell*> cellSet; Cell...

How to control what happens when a program is iconned in Windows XP

I have a real-time program that needs to be operating continuously. When the program is iconned, it seems that it sometimes stops updating and other times will abort when it is restored to the active state. Is there a method of controlling what happens when my program is iconned? I am using Visual Studio 2005. ...