GetDlgItem fails for an ActiveX control

Was working with a customer yesterday who was having this issue of GetDlgItem failing to return a valid window handle for an ActiveX control placed on a dialog. The ActiveX control is visible though but curiously the handle was always showing up as NULL. While debugging saw this particular line in the Visual Studio 2010 […]
Continue reading…

 

error LNK2022: metadata operation failed (801311E4) : Duplicate managed types have different visibilities

You will stumble upon this error if you are migrating your C++/CLI project from Visual Studio 2010 to Visual Studio 2012. One scenario for this error is when you are setting a different visibility for a native element and another include file has already set another visibility. Something like… #include <anotherinclude.h>#pragma make_public(g_SomeNativeType) Here you are […]
Continue reading…

 

Hidden VC++ compiler switches: /showIncludes

This hidden Visual C++ compiler switch will print out the full path of files included via #includes. You add this option likewise… Sample output… 1>  Note: including file:  C:Program Files (x86)Microsoft Visual Studio 10.0VCatlmfcincludeafxwin.h 1>  Note: including file:   C:Program Files (x86)Microsoft Visual Studio 10.0VCatlmfcincludeafx.h 1>  Note: including file:    C:Program Files (x86)Microsoft Visual Studio 10.0VCincludenew.h 1>  […]
Continue reading…

 

How to enable LARGEADDRESSAWARE?

The command to enable large address aware is as follows… EditBin /LARGEADDRESSAWARE NotePad.exe How to check if the above command worked or not? Run the above executable (in our case NotePad.exe) with DumpBin.exe. C:> DumpBin /Headers NotePad.exe FILE HEADER VALUES              14C machine (x86)                4 number of sections         4BA1DC16 time date stamp Thu […]
Continue reading…

 

__noop intrinsic

What do we mean by intrinsic? Most functions are contained in libraries, but some functions are built in (that is, intrinsic) to the compiler. These are referred to as intrinsic functions or intrinsics. Taken from MSDN… The __noop intrinsic specifies that a function should be ignored and the argument list be parsed but no code […]
Continue reading…

 

Hidden VC++ compiler switches: /d1reportSingleClassLayoutSomeType

Did you ever want to know how a C++ class was laid out by VC++ compiler? There are few hidden switches which are not known to many hence would like to share those with my blog readers. So I will blog about these switches one by one. So for today the switch I’m going to […]
Continue reading…

 

New Book “Parallel Programming with Microsoft Visual C++” now available!

Note: Quote from a mail that I received. Last fall we shipped Parallel Programming for Microsoft .NET and immediately started working on a companion version of the book for C++ programmers. I’m very happy to announce that Parallel Programming with Microsoft Visual C++: Design patterns for Decomposition, and Coordination on Multicore Architectures is now available! […]
Continue reading…

 

Breakpoints in Windbg

WinDbg rocks. 🙂 Setting breakpoints is very easy in WinDbg. The command to set a breakpoint is ‘bp’. So if you want to break whenever a dll is loaded into a process then type in following command… [sourcecode language=”cpp”]bp kernel32!LoadLibraryW[/sourcecode] So to trigger this breakpoint attach ‘notepad.exe’ to the debugger and then type in this command. Now let the app run […]
Continue reading…