visual-c++

how to get message of catch-all exception

If I want to write useful info to a file whenever i caught a catch-all exception, how to do it? try { //call dll from other company } catch(...) { //how to write info to file here??????? } ...

How to convert PUNICODE_STRING to bstr?

Hello I'm calling a function which is in a ComVisible managed dll from a VC++ code. In the managed dll the function parameter type is string. In the VC++ code i've the variable as PUNICODE_STRING. How can i pass it to the function? How can i convert it into BSTR? Thank you. NLV ...

Reading a value in associative array creates a new key..

Hi, I have code such as this. I use pvalueholder is class that is polymorphic , it can hold all sort of types, string..etc.. It also can have a type undefined. typedef hash_map<pvalueholder,pvalueholder,pvaluehasher > hashtype; hashtype h; pvalueholder v; v="c"; h[v]=5; // h has one element pvalueholder v2=h[v]; // here h gets a new...

how to initialize a char array?

char * msg = new char[65546]; want to initialize to 0 for all of them. what is the best way to do this in C++? ...

Microsoft Visual C++ 2010 Express - project creation failed

When I try to create a new project, it says: Creating project 'example'... project creation failed. I tried to reinstall, it didn't work, I googled about the error, and all the answers for VCExpress 2008. There are some people who asked about the error for 2010, but nobody answered them. I'm using Vista. ...

LNK 2028 - 2019 / Managed and Unmanaged C++ ? (VS 2008)

Hi, I am trying to link an open-source library to one of my project. The library is unmanaged (named Tetgen) and my project is in managed C++. I create a .lib or a .dll, that doesn't change anything. My project recognizes the header and can use the functions defined in it, but cannot access to the cpp. I got a 2028 error each time it wa...

Using Gnuwin32 with Visual Studio (VC++)

Hi, Can someone explain me or direct me to some usefull links which tell how to make Visual Studio 2008 use Gnuwin libraries. And please tell me which Gnuwin package I should download.(Windows xp) I have been tring hours with out any luck. This is related to the question I asked here. Thank You ...

Automatic Compilation with Resource modification

Hello, I am using Visual Studio 2008. Is it possible to perform automatic build of a solution whereby you are able to change the resource file/other files for the project to take the values into? For example, expiry date. Each time I need a new expiry date, I will have to open up the solution, open the relevant source file, modify the ...

How to load an XML file and get values from the nodes - VC++

Hello I'm new to VC++ and i want to load an XML file and read the values from the nodes using VC++. Any guidance? Thank you NLV ...

Is it possible to link several 3rd party static libraries into a single DLL.

I have multiple 3rd party statically linked libraries for my application, as well as my own DLL that contains all my commonly used code across my applications. My main question is, is it possible to link those 3rd party libraries into a single dll, instead of directly into the application. If possible, it would cut down the EXE file-siz...

How to translate RPC_STATUS into HRESULT?

In my COM component I need to translate all errors into the most suitable HRESULT values possible. Currently if I call some RPC interface method (I call a MIDL-generated stub that in turn calls NdrClientCall2()) and the call fails I return E_FAIL which is not very convenient. There's so-called facility in HRESULT. Can I use this? I tri...

Add a bit map image to Radio Button in vc++

Hi All, I need to add a bit map image to a radio button in MFC . i have no idea on how to do it can any one tell me how to do it. ...

Scope of pure virtual functions during derived class destruction - In C++

Hi, During destruction of the derived class object, i first hit the derived class destructor and then the base class destructor (which is as expected). But i was curious to find out - at what point does the functions of the derived class go out of scope (are destroyed). Does it happen as soon as the control leaves the derived class des...

How to install/link NTL with Visual C++ 2010?

Hi, I cannot install WinNTL-xxx to my MSVC++ 2010. The instruction come up in http://www.shoup.net/ntl/doc/tour-win.html is for MSVC++6. Can anyone help me in this regard? Thanks ...

supporting for each loop in classes

hi how can i add "for each" support for my class in c++0x and visual studio 2010? ...

How to switch on the "auto-build" option in VS2008

What option (where it is located in VS2008 menu) is need to be switched on in order VS2008 compile and build solution before launch (native C++ project)? Thanks. ...

Breaking on a button click event in Visual Studio debugger

This question is regarding the debugger in Visual Studio 2008. I am working on a C++/MFC application with a huge codebase (thousands of .cpp files). I'm looking for a way to tell the debugger, "The next time I click a button in my app, stop at the function called by that button". I'm trying to avoid trolling through those thousands of fi...

Split functionality for MFC Cstring Class

How to Split a CString object by delimeter in vc++? for example i have a string value "one+two+three+four" into a CString varable. ...

How to read file which contains \uxxxx in vc++

Hello i have txt file which contents is this \u041f\u0435\u0440\u0432\u044b\u0439_\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439_\u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442_\u043a\u0430\u043d\u0430\u043b how can I read such file to get result like this: "Первый_интерактивный_интернет_канал" If i ty...

object declare in vc++

a.hbrBackground=GetStockObject(WHITE_BRUSH); error: cannot convert from 'void *' to 'struct HBRUSH__ ' Conversion from 'void' to pointer to non-'void' requires an explicit cast Cannot execute the above code in vc++ Please check the code. ...