c++

Is C++0x collapsing under the weight of new features and the standardization process?

From Dr. Dobbs: Concepts were to have been the central new feature in C++0x Even after cutting "concepts," the next C++ standard may be delayed. Sadly, there will be no C++0x (unless you count the minor corrections in C++03). We must wait for C++1x, and hope that 'x' will be a low digit. There is hope because C++1x...

Reading a UTF-8 Unicode file through non-unicode code.

I have to read a text file which is Unicode with UTF-8 encoding and have to write this data to another text file. The file has tab-separated data in lines. My reading code is C++ code without unicode support. What I am doing is reading the file line-by-line in a string/char* and putting that string as-is to the destination file. I can'...

How to get the SQLSERVER installationPath using C++??

Hi How to get the Sqlserver Installation Path Programatically. If we go for the Registry Then Registry Hives May be Different from one OS to other OS Like w2k3 to w3k8 and VISTA and W2k8 R2 like that.. But i did Using Registry as follows But I gave Some Hard Code Key vAlues If Hives are same then no problem if Different The Problem...

Problem with IDropTarget when using with a VCL Form

I have a VCL gui developed in Codegear. I have created a DropTarget for the mainform and the DropTarget object implements the IDropTarget interface which allows me to drag and drop files from explorer. Now because I only want some of the child components to be drop targets (not the whole form), I only have the DragEnter method return S_O...

Does the compiler decide when to inline my functions (in C++)?

I understand you can use the inline keyword or just put a method in a class declaration ala short ctor or a getter method, but does the compiler make the final decision on when to inline my methods? For instance: inline void Foo::vLongBar() { //several function calls and lines of code } Will the compiler ignore my inline declarati...

is it possible to store output of system call in windows?

for ex: i want to store output of system("dir"); Thanks & Regards, calvin ...

I'm getting compile errors in the standard library. What's up?

I'm trying to compile an unspecified piece of software, and I'm getting errors in the standard headers such as stdio.h. The errors are mostly undeclared identifiers such as _In_. IntelliSense finds their definitions just fine. In what general direction should I look for the cause of this? Added: For example, in one cpp file stdio.h is t...

Writing a QNetworkReply to a file

I'm downloading a file using QNetworkAccessManager::get but unlike QHttp::get there's no built-in way to directly write the response to a different QIODevice. The easiest way would be to do something like this: QIODevice* device; QNetworkReply* reply = manager.get(url); connect(reply, SIGNAL(readyRead()), this, SLOT(newData())); and...

MS VC++ 6 : Why return !false rather than true?

Looking at some code I noticed that another dev had changed every instance of true to !false. Why would you do that? thx ...

Is there C++ class that implements operations with permutations?

Is there C++ template class that implements operations with permutations and permutation group? Such class has to implement finding product and inverse, multiplication, etc. ...

which embedded web server to use for my app GUI

Hello, I'm writing an application in c++ and I was thinking to use an embedded simple web server that will be my gui, so i could set up my application port on localhost. What such web server would you recommend to use in c++/c? Thanks ...

Process ID and OS Information in C++

Hi In python I can use os.getpid() and os.name() to get information about the Process ID and OS name. Is there something similar in C++? I tried GetProcessId() but was told that this is undeclared... I am using Cygwin under windows. Thank you ...

How to Programatically get a Browser Pointer from Firefox Main Window

I want to get the WebBrowser Pointer of firefox How to get it using VC++ as Development Environment ...

WebBrowser control: Detect navigation failure

I am hosting a webbrowser control, that usually loads an external documents, then makes some modifications using HTML DOM. We also embed custom application links using a fake protocol, such as "Close This" that are caught and handled in BeforeNavigate2. When the link tarket is misspelled (say, "spp:CloseWindow"), BeforeNavigate will no...

how to print the unicode characters in hexadecimal codes in c++

I am reading the string of data from the oracle database that may or may not contain the Unicode characters into a c++ program.Is there any way for checking the string extracted from the database contains an Unicode characters(UTF-8).if any Unicode characters are present they should be converted into hexadecimal format and need to displ...

How to read code without any struggle

Hello, I am a new to professional development. I mean I have only 5 months of professional development experience. Before that I have studied it by myself or at university. So I was looking over questions and found here a question about code quality. And I got a question related to it myself. How do I increase my code understanding/read...

Returning multiple auto_ptrs from a function

Hello, I have a function that allocates two variables on the heap and returns them to the caller. Something like this: void Create1(Obj** obj1, Obj** obj2) { *obj1 = new Obj; *obj2 = new Obj; } Usually, in similar cases, when I have a function with one variable I use the "source" trick with auto_ptr: auto_ptr<Obj> Create2() ...

C++ MVC Model - How should it be implemented?

Hi, I'm a little confused as to how the model should 'work' in my basic C++ implementation, or rather how the data from say the database backend should be encapsulated/worked with. My thoughts at the moment are for a model with for example a static findById() method, which would return an instance of that same model, which would then r...

How to map a resource file in QT 4.5?

Is it possible to map a resource in QT 4.5? For example: QFile file(resource_name); file.open(QIODevice::ReadOnly); uchar* ptr = file.map(0, file.size()); When I try this, ptr == 0, indicating an error. It works fine if I try to map a regular file. I am running qt on linux, which supports QFile::Map. ...

Crossplatform Sqlite3 Wrapper for C++

Hi, I am looking for a crossplatform Sqlite wrapper for Sqlite3. Any suggestions? Thanks ...