c++

What is the Win compile switch to turn off #pragma deprecated warning?

Using Visual Studio .NET 2003 C++ and the wininet.dll Am seeing many C4995 warnings More info Any help is appreciated. Thanks. ...

Queue giving erroneous data

So I'm attempting to use a queue to parse some input, turning prefix mathematical expressions into infix mathematical expressions with parentheses. For example: +++12 20 3 4 turns into (((12+20)+3)+4). For the most part, my algorithm works, except for one specific thing. When the numbers are greater than 2 digits long, the output becomes...

Qt - How to do superscripts and subscripts in a QLineEdit?

I need to have the ability to use superscripts asnd subscripts in a QLineEdit in Qt 4.6. I know how to do superscripts and subscripts in a QTextEdit as seen below but I can't figure out how to do them in QLineEdit because the class doesn't contain a mergeCurrentCharFormat() function like QTextEdit does. Please help. Thanks void MainWind...

Function that counts the number of integers in a text file?

I need to write just a function that counts the number of integers in an already opened and good text file. a. Assume there is a text file with a large number of integers divided by spaces b. Write a function called analyzeFile that accepts a previously opened ifstream file object as a parameter, and counts the number of integers in th...

How can I run an external program without waiting for it to exit?

Hi - I'm trying to execute an external program from inside my Linux C++ program. I'm calling the method system("gedit") to launch an instance of the Gedit editor. However my problem is while the Gedit window is open, my C++ program waits for it to exit. How can I call an external program without waiting for it to exit? ...

C++ ISAPI Filter Code

I know very little about C++ but I'm trying to tackle something for work and need some help... I'm using this C++ ISAPI filter code to add a message to the top of a page on a IIS web server running ASP and CFML. This is a web server that will be going away and need a way to notify the users. This code works for the most part, however...

How can i stream CCTV camera to iphone from windows.

Hi, I am trying to build an iphone app that connects to an IP camera. The IP camera is windows based to i need to create a server using c++ and then stream the video to the iphone app. Can anyone tell me the best way in going about this task. I am new to programming so a dummies type guide would help. Thanks Inam ...

how to get namespace prefixes from XML document, using MSXML ?

For example, In this document < ?xml version="1.0" ? > < SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://opcfoundation...

One question about vector push_back

I just noticed that for vector push_back it is push back a reference to the element. void push_back ( const T& x ); My question is does the memory layout changed after push_back? For example, I have an array first which containing five elements and the layout is like this. | | | | | | ...

Disable full keyboard and mouse when console of c is running in window OS

Is it possible to disable full keyboard and mouse when I run my c program in window OS. Kindly guide me how can I make it possible. ...

Hide Console of c program in window OS

I want to hide my console of c when I run my application, kindly guide me how can I make it possible so that my application run in the background. ...

Is a "factory" method the right pattern?

Hey all - So I'm working to improve an existing implementation. I have a number of polymorphic classes that are all composed into a higher level container class. The problem I'm dealing with at the moment is that the higher level container class, well, sucks. It looks something like this, which I really don't have a problem with (as th...

Track/Display Array Index As Part Of Cout (C++)

Hi, I have a command line C++ program that lets you enter basic information about a person (ID number, name, age, etc.) and I want to output to a console in the following manner: ------------------------------------------------------------------- Index ID # First Name Last Name Age ---------------------------...

Visual Studio: How to add existing project using environment variable?

I have a a project that resides on a "thumb drive" (a.k.a. memory stick). Due to Windows ability to change drive letters of thumb drives, I would like to specify the location of sub-projects using an environment variable. This allows me to set the thumb drive drive letter, depending on the PC that I am using; or change the variable whe...

Using clang to analyze C++ code

We want to do some fairly simple analysis of user's C++ code and then use that information to instrument their code (basically regen their code with a bit of instrumentation code) so that the user can run a dynamic analysis of their code and get stats on things like ranges of values of certain numeric types. clang should be able to hand...

Unit Testing Refcounted Critical Section Class

Hello all :) I'm looking at a simple class I have to manage critical sections and locks, and I'd like to cover this with test cases. Does this make sense, and how would one go about doing it? It's difficult because the only way to verify the class works is to setup very complicated threading scenarios, and even then there's not a good w...

How can I force Doxygen to show full include path?

How can I force Doxygen to show full include path? What do I mean: I have a class foo::bar::bee defined in bee.hpp in following directory structure: foo foo/bar foo/bar/bee.hpp Doxygen, when it documents foo::bar::bee class tells that you need to include <bee.hpp>, but for my software I need <foo/bar/bee.hpp> How can I cause Doxyge...

C++ - Access array (in main) from methods outside main

I have an array in my main class that holds objects that I need to print out for a menu listing. The array is declared and initialized in main. I need to, however, access the same array in a sub-menu function. If I copy the code (for loop that prints out the values) to the sub-menu, nothing is printed (presumably because it can't access ...

Writing preprocessor directives to get string

Can you write preprocessor directives to return you a std::string or char*? For example: In case of integers: #define square(x) (x*x) int main() { int x = square(5); } I'm looking to do the same but with strings like a switch-case pattern. if pass 1 it should return "One" and 2 for "Two" so on.. ...

Why is OnDragEnter not called?

I have added the COleDropTarget variable to my view class and registered it in the OnCreate(), which is being called at startup. I added the OnDragEnter and OnDrop virtual functions (not the others yet, as OnDragLeave). But they are not called when I drag (or drop) a piece of text over them. I just happened to think about the fact that ...