visual-c++

How to read a REG_MULTI_SZ type value from the registry using RegQueryValueEx(..) in c++

In our vc++ win32 application we are reading a registry value of type reg_multi_sz, its working fine on 32-bit but giving empty buffer when i ran on 64- bit. How can I read values of 64 bit registry from my 32-bit application ? ...

How do I find the cause of this linker error?

After going through a lengthy process to rename a project, my DLL project will not build in Debug mode (Release builds work): MSVCRTD.lib(msvcr90d.dll) : error LNK2005: _CrtDbgReportW already defined in LIBCMTD.lib(dbgrpt.obj) This project, and the five static libraries it depends on, are set to use "Multi-threaded Debug (/MTd)" (unde...

Manually drawing gradients for buttons, toolbars, tabs etc?

I would like to update some toolbar-like code we have to have a Vista/Win7 gradient roundedness to them. Currently, the buttons have the Windows 2000 look & feel: blocky, single-tone. I've played around with the XP themes, and using DrawThemeBackground, DrawThemeEdge, etc.; but I'm very dissatisfied with the theme drawing mechanics (th...

"Use MFC in a Static Library" links to MFC80U.dll

In my Windows CE DLL project, I am trying to tell Visual C++ to link statically to MFC in a project that originally did not use MFC. However, upon linking successfully, Dependency Walker (depends.exe) says that my DLL is dynamically linked to MFC80U.DLL and MSVCR90.DLL. Has anyone else encountered this bug? If "Use of MFC" is set to "Us...

Unhandled exception: 0x80000001: Not implemented. (VC++)

Hi all, I am using MS Visual Studio 2005 (C++).. Could anyone tell me what could cause a runtime exception like so..? Unhandled exception at 0x07ed0027 (xxx.dll) in yyy.exe: 0x80000001: Not implemented. xxx.dll is a dll i am working on and yyy.exe is an exe that is calling that dll.. When the undhandled exception comes up while d...

Load a CBitmap dynamically

I have a Bitmap image that i want to load dynamically. But I am unable to load it. CBitmap bmp; bmp.LoadBitmap("c:\aeimg"); it does not seem to be working. Can someone please help me. Thanks. ...

On which occasions exactly is WM_ACTIVATE sent?

I'm trying to debug a huge Win32 GUI application (I have full sources) divided into several processes. The problem is the following: in one process I have a dialog with a listbox, when I double-click an item in the listbox another process is started that creates its own window that is brought to front and covers the initial dialog. If I ...

referenced argument to a function with default value in C++

Possible Duplicate: Default value to a parameter while passing by reference in C++ Is it possible to do something like this: // definition bool MyFun(int nMyInt, char* szMyChar, double& nMyReferencedDouble = 0.0); Then the function can be called either like this: MyFun(nMyInt, szMyChar, nMyReferencedDouble); or like this: ...

DLL : export as a C/C++ function ?

Hello, I generated a DLL in Visual from a C++ code. Dependency Walker sees 3 functions exported as C functions. I made an SCons project to do the generate the DLL, and 2 of the 3 functions are not seen as C functions. What makes a function seen as a or C++ function, without modifying the code ? It must be in the compilation/linking op...

Storing source files outside project file directory in Visual Studio C++ 2009

Visual Studio projects assumes all files belonging to the project are situated in the same directory as the project file, or one underneath it. For a particular project (in the non-Visual Studio sense) this is not what I want. I want to store the MSVC-specific files in another folder, because there might be other ways to build the appli...

What's an easy way to edit 256+ color toolbar resources in VS2008?

When I go to edit a toolbar resource in VS2008, it converts it to a 16color (4-bit) bitmap. WTF? What do you use to edit toolbars that doesn't suck? You've got to be kidding me... surely there is an add-on or a plug-in to the VS2008 resource editor to make it work correctly with high color bitmaps? This just seems insane. How are al...

porting from 32 bit to 64 bit

I have windows application build using Visual C++. Its being build and run on 32 bit windows env. Now I need to make sure it works on windows vista / 7 64 bit env. What all things I need to consider for this porting process ?? ...

Fetching CBitmap out of CImageList

I inserted bitmaps in CImageList in one Function and needed to change some of the images later in another function. But I am unable to extract the CBitmap. The code goes something like this: CBitmap GetIndividualBitmap(CImageList oImgList, int nBmpNo) { IMAGEINFO imgInfo; imagelist.GetImageInfo(index,imgInfo); CBitmap bmp; bmp.FromHan...

link error while porting to vs2005

hi I am getting the following link error, as it says it is already defined in other library, and I have set the same settings for my libraries which are linked to this, I used standard windows library and multi threaded option msvcprt.lib(MSVCP80.dll) : error LNK2005: "public: char const * __thiscall std::basic_string,class std::alloc...

Will C++ exceptions safely propagate through C code?

I have a C++ application that calls SQLite's (SQLite is in C) sqlite3_exec() which in turn can call my callback function implemented in C++. SQLite is compiled into a static library. If an exception escapes my callback will it propagate safely through the C code of SQLite to the C++ code calling sqlite3_exec()? ...

Setting compiler and linker directories via pragma in Visual C++

Is it possible in Visual C++ to set additional include directories and additional libary directories in the source code itself, through pragma definitions (similarly to #pragma comment(lib, "xxx.lib") to link specific libs)? ...

How does CreateMutex() internally work?

Basically, it is used to make an application instance singleton. I wish to know, how it works internally and how does OS manage it ? ...

Build system for a VISUAL STUDIO 2008' C++ project

Hi, i'am developing a rigid body simulation (physics) in my workstation and i need to share this project with teachers from my university. The problem is the workstations of my teachers have different configurations about the path of some libraries. How i can externalize the paths on a VS2008 C++ project? ...

Product Name define for visual c++ and c#

Our product contains a bunch of modules spread out over several visual studio solutions and uses C++ and C#. I'd like to define a product name and use it as part of default folder locations, registry keys, etc. What is the simplest way to define this product name in one place? And if I have to use a different approach for C++ and C#, ...

Visual Studio 6 Processor Pack Enabling SSE2

How do I enable the SSE2 instruction set in MSVC 6.0 with SP5 and Processor Pack installed? I was expecting to see a compiler option under Project Settings | C++ | Code Generation, as I'm used to on MSVC2005. But I don't. Is it via command line only? ...