c++

How different is Qt4 from Qt3?

I used to program in Qt3 a long time ago and I had read a great book that I still have by O'reilly on Qt3. I wanted to start using Qt4 again now several years later. Can I use my Qt3 book to get up to speed again, or has things changed so much that I should buy a Qt4 book? ...

overriding GetSecurityId in IInternetSecurityManager

I have built an executable which launches a dialog box in which is embedded the IE web browser active-x control (C++). I want this control to allow cross site scripting. One frame on the web page loads local html, the other loads from a server. I then want the server page to call a javascript function that lives in the local html file...

How to obtain Windows special paths for a user account from a service

I want to be able to retrieve Windows "special paths" (e.g. temporary files folder, desktop) for user accounts, but from a service. I know the normal way to do this is by using SHGetFolderPath with the appropriate CSIDL for the folder type. Is there any way to get this type of info for each user without the service having to log in as ...

Why compiler provides default copy constructor

Hi, I wanted to know Why compiler provides default copy constructor..Whats the strategy behind that idea. Thanks in Advance. ...

C++ call virtual method in child class

hi guys, i have the following classes: class A { protected: A *inner; public: .... virtual void doSomething() = 0; .... } class B: public A { ... void doSomething() { if(inner != NULL) inner->doSomething(); } ... } When I use inner->doSomething() I get a segmentation fault. What should I...

Why is this an "overloading ambiguity" in gcc?

Why is this an error : ie. arent long long and long double different types ? ../src/qry.cpp", line 5360: Error: Overloading ambiguity between "Row::updatePair(int, long long)" and "Row::updatePair(int, long double)". Calling code: . . pRow -> updatePair(924, 0.0); pRow -> updatePair(925, 0.0); . ...

Data structure for fast line queries?

I know that I can use a KD-Tree to store points and iterate quickly over a fraction of them that are close to another given point. I'm wondering whether there is something similar for lines. Given a set of lines L in 3D (to be stored in that data structure) and another "query line" q, I'd like to be able to quickly iterate through all l...

How to create native DLL in Visual Studio from C# code?

I have the source code of a C# program. I want to create a DLL out of it which I want to use in C++. Is it possible to create a native DLL in Visual Studio 2008 which can be used in C++? ...

Communicate between AIR(Flex) and C++ Applications

I need to be able to communicate between two applications that reside on the same machine. One is using Flex and the other is in C++. I would like to be able to call functions and pass arguments to each other. What is the best way to communicate between them? I was thinking about using sockets. ...

POCO C++ - NET SSL - how to POST HTTPS request

Hello How to correctly do a POST to HTTPS server and embed the login data correctly. Below code does not return any cookies (in Wininet it does). I wonder how POCO HTTP library handles HTTP redirections? MyApp() { try { const Poco::URI uri( "https://localhost.com" ); const Poco::Net::Context::Ptr context( new Po...

convert astronomically large numbers into human readable form in C/C++

My program prints out HUGE numbers - like 100363443, up to a trillion -- and it sort of hard to read them, so I would like to print any number in easy to read form. right now I use printf ("%10ld", number); format I would appreciate a resulting number using printf. Most of my code is c++ yet I don't want to introduce std::cout, as...

Fastest way to share a connection and data from it with multiple processes?

I have multiple app processes that each connect to servers and receive data from them. Often the servers being connected to and the data being retrieved overlaps between processes. So there is a lot of unnecessary duplication of the data across the network, more connections than should be necessary (which taxes the servers), and the data...

Boost Graph as basis for a simple DAG Graph?

I'm looking at using Boost Graph Library as the basis for a dag graph. I haven't really used it all that much before, so not too familiar with how it works. Although I don't need edge weights and clever traversing algorithms, I would quite like to get the serialisation for free, plus the constraints enforcing dag graphs and disallowing ...

Input Method Editor windows return FALSE for WM_QUERYENDSESSION - why?

We have a bizarre and very infrequent issue where people can't log off the Windows server when our product is running. The system is multi-application, all MFC/C++. The apps are run from a management service so they survive logoff. It's been running fine for donkeys years in loads of installations around the world. I wrote a test appli...

Installing Boost libraries on Snow Leopard

I have followed the directions on the boost website. I have put the boost dir in the path. I still cannot compile a C++ program using the boost libraries. I am specifically trying to use the filesystem library. Any help is greatly appreciated. --TJB ...

How do I define a SWIG typemap for a reference to pointer?

I have a Publisher class written in C++ with the following two methods: PublishField(char* name, double* address); GetFieldReference(char* name, double*& address); Python bindings for this class are being generated using SWIG. In my swig .i file I have the following: %pointer_class(double*, ptrDouble); This lets me publish a fiel...

How to easy convert LPBYTE to char[256] (used to read text from windows registry)

How I can convert LPBYTE to char [256]? When I read from Windows registry value: blah REG_SZ "blah some text" char value[256]; DWORD keytype = REG_SZ; DWORD dwCount = sizeof(value); RegQueryValueEx((HKEY)key, "blah", 0, &keytype, (LPBYTE)&value, &count); cout << "Read text from registry: " << value << endl; after cout this it shows...

Utf-8 in c++: quick & dirty tricks

Hi, I am aware that there are been various questions about utf-8, mainly about libraries to manipulate utf-8 'string' like objects. However, I am working on an 'internationalized' project (a website, of which I code a c++ backend... don't ask) where even if we deal with utf-8 we don't acutally need such libraries. Most of the times the...

What is the best practice for creating libraries that support both Unicode and ASCII in C++?

I'm working on writing some libraries that will be used both internally and by customers and was wondering what the best method of supporting both Unicode and ASCII. It looks like Microsoft (in the MFC Libraries) writes both the Unicode and ASCII classes and does something similar to this in the header files using macros: #ifdef _UNICO...

visual C++ declaring a string array

i want to use unmanaged C++ std::string nodename[100]; this command give following error even though i use #include"string.h" also 'std' : is not a class or namespace name ...