visual-c++

C++ Calling a EXE from a method

Hi i need to call a external EXE (same running exe )from a C++ method i used system("filepath"); but in the current file closed and new exe doesn't create the new instance How can i call a exe with absolute path ? ...

C++ Number input validation

I need to validate a user input using getch() only to accept numeric input `int input_put=getch();` if(input >=0 && < 9){ }else{ } ...

How can I use xml resource file as url.

I have to use one API with params like XYS(LPWSTR UrlOfXmlFile); This API is exposed from a third party COM dll. Now I want to call this api with a url of xml file .This works fine when user is online. But if user if offline then I want to embed xml file as resource in VC++ with some values and want to pass this xml file as url to t...

How do I read and export a subtree of Windows registry without running Regedit?

I have a 32-bit C++ program that gathers diagnostic data to help troubleshoot our software. I'd like it to export a certain subtree of the registry - something like: regedit.exe /e ExportResult.reg HKEY_LOCAL_MACHINE\SubTreeIWantToExport The problem is Regedit will likely require priviledges elevation on Vista and above and the user r...

Running a C++ Console Program in full screen

How to run a C++ Console Program in full screen ? , using VS2008 ...

C++ Colors in console [Different colors in different text ]

How to add different colors in the C++ console ? , can use a one color but is there a way to use different colors in console ? ...

Error while dll load

Hi, My program tries to load some dlls. The problem doesn't come during the first load. But it comes every 7th time. I guess there is memory corruption. Is there a tool or something to debug the memory corruption for visual c++. I tried some memory leak tools but there is no memory leaks. please help!!! regards, Suresh ...

Changing from a static lib to a dll slows compilation

Using VS2003, we migrated our C++ application from a quasi-monolitic to a dll distributed application. In the process, the compilation time of our complete application (exe and dll) slowed down considerably. Certain files (going from a static lib to a dll) get 3~4 times slower to compile (no change of code). I made a test on our larges...

start without debugging (F5) and start with debugging (Ctrl + F5)

Hi, I have been working on a uni C++ project. I am presently using VS2010 . It is almost the end and now I am facing a strange problem. I try to run my program in debug mode by pressing F5. It works fine. Then I try to run the program by pressing Ctrl + F5, and I get an exception at free.c (It gives an exception to vector.push_back)....

How can i fire key press or mouse click event without touching any input device at system level

i want to fire automatic key press or mouse click event when a color appears on the screen on other application or Browser.... ...

Visual C++ 2010 Underline errors in NEW files with #define not working?

Hi. Im having problems with the visual studio 2010 editor. Since today, visual studio wont underline errors anymore if i use #define like so: #ifndef TEST_H #define TEST_H class foo{ blabla } #endif If i remove the defining commands, the errors show up. The wierd thing is, i have other files in my project with the exact same setup an...

VS2008 Compile error with <winsock2.h>

Getting heaps (105) of redefine & syntax errors when trying to compile my VS2008 c++ project with <winsock2.h> included. Running Windows 7 64bit. I have googled and searched and the answer seems pretty uniform but it doesn't seem to work for me. Tried putting #include <winsock2.h> before #include <windows.h>. Also tried not including <w...

Update an href on an IHTMLLinkElement

I need to update the contents of an href on an IHTMLLinkElement. What I've come up compiles but causes an error as soon as it's execute static const CComBSTR href(L"http://www.google.com"); spLinkElement->put_href(href); // IHTMLLinkElement The error I get is Program: C:\Program Files\Internet Explorer\IEXPORER.EXE File: c:\program ...