c++

Connect c++ application with an http calls?

Hello, is it possible to get the output of an c++ project as http request eg:http://localhost:8080 just it need to output an xml or just any output... ...

how to change highlight color in list control in mfc

how to change highlight color in list control in mfc. i havn't found any api in clistctrl. i have override NM_CUSTOMDRAW as descripbed in msdn but when i clicked on any item on list it showing half blue color and half black color why blue is coming ? ...

What is the function try block handler?

I came across this question recently - What is function try block handler? Also, where would it be useful? ...

C++ Function Call Operator Overloading syntax

Hi. I'm an intermediate C++ user and I encountered the following situation. The class definition shown below compiles fine with a g++ compiler. But I cannot put my finger on what exactly the whole syntax means. My guess is that the function operator int() returns an int type. Moreover, I cannot figure out how to use the overloaded op...

What's the best practice to reverse engineering a binary file in windows?

In my case it's written in c/c++,if that matters. ...

Problem Exporting C++ symbols

iam trying to export some C++ symbols from GTK webkit code with default flags -fvisibility=hidden and -fvisibility-inline-hidden Only the C apis seem to be exported and work: #define API __attribute__((visibility("default"))) class API export1 { public: void export1_f(); }; API void export2(); extern "C" API void export3(); Out...

operator overloading + operator in c++

Hi i am facing a problem with the code below which is run on VS c++ 2008.How to write the function definition for operator + when you have a statement to be overloaded as follows class Distance { private: int feet,inches; }; main...... Distance Obj, Obj1(2, 2); Obj = 3 + Obj1; // this line here Obj1+3 is easy but how in this on...

iPhoneOS: using detachNewThreadSelector method inside a C++ class method

Hello guys, I have a C++ class method where i need to call the "detachNewThreadSelector" method with all the parameters. Here lies the problem, as my class is not objective C i don't have a self pointer. Also i don't see how i will be able to call a class method from the method that i will set as selector. Please do ask if my question is...

How to extract selected area of the gui component to PDF in QT

Hi guys I need to make the tool like Snagit and to take the picture the selected area of the component. I'm searching how to make this tool in Qt. I firstly prefer using Qt native library but if there is no library which fullfills this requirement, any good c++ libray can be accepted for me. Any help will be appreciated...

c++ vectors causing break in my game

my works like this i shot airplanes and if the shot toughed an airplane it change there positions(airplane and the shot) than it will delete them. if i toughed an airplane the airplane position gets changed. than it gets deleted than my health reduces. well that works well expect that it breaks when i have about 2-4 airplanes left and i ...

c++ gtk open multiple window

I'm still working on the example at this link: http://stackoverflow.com/questions/3547548/gtkmm-statusicon-quits-after-creation I changed the function in this way to open the traybar different windows, but does not show anything. void Tray::on_statusicon_popup(guint button, guint activate_time) { printf("popup!\n"); Gtk::Window ...

std::random_shuffle, compliler error: no matching function for call [closed]

Hi! I cannot compile following code by g++ 4.3.2: #include <stdlib.h> #include <algorithm> struct Generator { ptrdiff_t operator() (ptrdiff_t max) { return rand() % max; } }; // ... Generator generator; std::vector<size_t> indices; // fill vector std::random_shuffle(indices.begin(), indices.end(), generator); // error here! ...

Pointer to members

In following code consider the statement :- "int B::*bpm;" class B { public : int bi; }; class D : public B { }; int main() { D obj; int B::*bpm; bpm = &B::bi; obj.*bpm = 1; return 0; } When to use "Pointer to members" in design/code to improve my design/coding practice. * ...

How Can I access Windows Service Object by Another Programme

I have a windows service which is creating a Named Pipe in it's service main Function. The code snippet is below: void WINAPI ServiceMain(DWORD argc, LPTSTR *argv) { DWORD status; DWORD specificError; m_ServiceStatus.dwServiceType = SERVICE_WIN32; m_ServiceStatus.dwCurrentState = SERVICE_START_PENDING; m_ServiceStatus.dwContro...

Why are templates so slow to compile?

Large templated projects are slow to compile, the STL being a main culprit of this it seems from empiric evidence. But, why is it slow to compile? I've optimized builds before by watching for header includes and by combining compilation units, but I don't get why template libraries are quite so slow to compile. ...

C++ - how to send a HTTP post request using Curlpp or libcurl

I would like to send an http post request in c++. It seems like libcurl (Curlpp) is the way to go. Now, here is a typical request that am sending http://abc.com:3456/handler1/start?&lt;name-Value pairs> The name values pairs will have: field1: ABC field2: b, c, d, e, f field3: XYZ etc. Now, I would like to know how to achieve the ...

OpenMp Fatal user error 1002

Hi, I'm using a basic omp parallel for, which works most of the time, but sometimes (with no difference in the input data) makes the program crash with the error: Fatal user error 1002 Not all work sharing construct executed by all threads. #pragma omp parallel for \ shared(szDetailedError, aCG) \ private(pCha...

Efficient pointer to integer mapping and lookup in C++.

I want to map pointer to integer for purpose of serialization. The pointers may be of different types and may point to polymorphic objects possibly using multiple inheritance. I need to query the map to know if the pointer is stored in it and if it is, then what is the associated integral value. What is the correct way to do it? The si...

Does endianness have an effect when copying bytes in memory?

Am I right in thinking that endianess is only relevant when we're talking about how to store a value and not relevant when copying memory? For example if I have a value 0xf2fe0000 and store it on a little endian system - the bytes get stored in the order 00, 00, fe and f2. But on a big endian system the bytes get stored f2, fe, 00 and ...

Variadic templates

Hi all, I have seen a lot of links introduced the variadic templates. But I have never seen one compilable example that demonstrates this approach? Could someone provides me some links in which such compilable examples can be found? regards Sami ...