c++

Globally Unique IDs for files in Windows

I'm wondering how to get globally unique IDs for files and folders in Windows (XP, Vista and 7), and also be able to get the full path of the file or folder just by having the ID, something like getFileByGUID. I'm trying to do this in C++, C# and PHP. The globally unique IDs should stay the same even if the file is moved, so using the f...

Extract correct text from a wifstream regardless of encoding.

Here is the program: http://codepad.org/eyxunHotThe encoding of the file is UTF-8. I have a text file named "config.ini" with the following word in it: ➑ball If I use notepad to save the file with "UTF-8" encoding, then run the program, according to the debugger the value of eight_ball is: âball If I use notepad to save the file wi...

Strange occurence with string and special character

#include <iostream> #include <string> using namespace std; string mystring1, mystring2, mystring3 = "grové"; int main(){ mystring1 = "grové"; getline( cin, mystring2 ); //Here I type "grové" (without "") cout << "mystring1= " << mystring1 << endl; cout << "mystring2= " << mystring2 << endl; cout << "mystring3= " << mystring3...

Distinguish between const and non-const method with same name in boost::bind

When I use boost::bind with a method name which is declared both const and non-const I am getting in ambiguous error, for example boost::bind( &boost::optional<T>::get, _1 ) How can I solve this problem? ...

If i develop c++ win32 GUI in xp ,will i have problem to run in it deferent win os's

Hello all i need to develop win32 GUI in c++ (plain win32 windows.h thing ) , I'm developing it in xp os how much problem will i have to port it to vista and windows 7 ? ...

c++ FFT Beat detection library?

Hi, I am currently looking around for a good allround beat detection library / source code in C++ since I found it really hard to achieve satisfying results with the beat detection code I wrote myself using this tutorial: http://www.gamedev.net/reference/programming/features/beatdetection/ It's especially really hard if you want to mak...

concatenate files without copying their contents

Hi, (In C/C++/Linux) Is there a way to concatenate file A and file B (or actually append one A's content to that of B) only by altering the file system without the overhead of data copying? File A then can be discarded. Thanks ...

why is this happening?

char* ReadNumericFormat = "%i"; int Read(void) { int Storage; __asm { LEA EAX, [Storage] PUSH EAX PUSH DWORD PTR [ReadNumericFormat] CALL DWORD PTR [scanf] ADD ESP, 8 MOV EAX, DWORD PTR [Storage] } } when the user enters "023919" the procedure returns 1...

AMQP C++ implementation

We are writing C++ code which needs messaging. Is there a free/open-source and stable AMQP server available that has equally stable C++ client library with it. We also need to provide Python interface of our code to users (idea is to do maximum stuff in C++ and expose the API in Python). What can be best way to achieve this. ...

Clean way to refactor test code

Background: I currently write test cases for the client side of a network protocol. As part of the tests I have to simulate several different expected and unexpected responses from the server (wrong header, connection lost, unexpected messages, timeouts). Each of these test-cases can be accessed by its unique address. My problem: The cur...

How to add menubar in my program with Visual Studio 2008 ?

I managed to create the menubar in the menu editor by clicking and writing text to each menu item i wanted. I cant see any button to get the code to include the menu in my program. How i can get this menu working? C++ ...

Intercept ActiveX/COM methods

Hello. There is a VB6 application with VSFlexGrid control in it. On My WinXP machine OCX is here: c:\WINDOWS\system32\Vsflex7L.ocx I assume application calls AddItem method of this OCX to add new items to the grid. And I want to intercept this call and obtain data passed to AddItem method. The question is - what is the best way to do ...

put different class in hierarchy in one container in C++

Hi, Some times we have to put different objects in the same hierarchy in one container. I read some article saying there are some tricks and traps. However, I have no big picture about this question. Actually, this happens a lot in the real word. For example, a parking lot has to contain different types of cars; a zoo has to contain d...

How to convert decimal number into 64 bit binary float number?

hi all, i need to convert decimal number into 64 bit binary float value. if u know any algorithm or anything about it then plz help. ...

Is there a AMQP implementation that has stable C++ Client libary

Is there a AMQP implementation that has stable C++ Client libary ...

Where can i find API for VK.com in C++

Where can i find API for VK.com (vkontakte.ru) in C++ ...

Dynamic allocation of memory

Lets consider following two codes First: for (int i=0;i<10000000;i++) { char* tab = new char[500]; delete[] tab; } Second: for (int i=0;i<10000000;i++) { char tab[500]; } The peak memory usage is almost the same, but the second code runs about 20 times faster than the first one. Question Is it because in first code ar...

Multithreaded Server Issue

I am writing a server in linux that is supposed to serve an API. Initially, I wanted to make it Multi-threaded on a single port, meaning that I'd have multiple threads working on various request received on a single port. One of my friends told me that it not the way it is supposed to work. He told me that when a request is received,...

How to write Cyrillic text in C++ console ?

For example, if I write: cout << "Привет!" << endl; //it's hello in Russian in console it would be something like "╧ЁштхЄ!" ok, I know that we can use: setlocale(LC_ALL, "Russian"); but after that not working command line arguments in russian (if I start my program through BAT file): StartProgram.bat chcp 1251 MyProgram.exe -use...

how to discover .dlls my application is using

iam trying my hand at using the crystal space api in my graphics applications. crystal space website The applications compile fine but iam having hell with the dlls(dynamic link libraries). The compiled application crashes at run time and i suspect its because of not finding the needed dlls. The only solution i currently have is cuttin...