Archive for the ‘Win32’ Category

Why MFC is bad

Well, MFC has lots of weird aspects. Basically MFC is a framework. What is a framework? Framework is a wrapper of API to make the API easier to use.
However, when MFC is compared to ToolBox which was most popular during similar period of time, MFC is not as easy to use as ToolBox. ToolBox is, [...]

Continue reading »

Visual C++ 2008 resource editing and control variable annoyance

Hmmm.. It was strange that VC++ 2008 add variables wizard didn’t let a “value” variable of a radio button. With VC++ 6, it was possible as far as I remember.
So, I searched to find out what changed since VC++ 6.
What I found are :

Visual Studio 2005의 DDX 매크로 문제
MSDN : Assign a variable to a [...]

Continue reading »

TerminateThread() and its consequence (Windows)

Usually when it is required to quit a thread from outside of its thread function, you declare a variable like shouldQuit, and it checks if the shouldQuit is set inside of the thread function. From outside of the thread function, you set the shouldQuit to tell the thread to quit.
However, if a function in a [...]

Continue reading »

How to prepare a target windows machine for debugging : Windows Side by Side Assemblies

With the Visual C++ 2005, MS introduced very weird entities to relieve the DLL hell. It is called Windows Side by Side Assemblies of Windows SxS.
However, it gives you another headache. It is like to bring foxes to expel tigers. It is very annoying to set-up target machine for debugging. If you have only one [...]

Continue reading »

Debugging a release build with the Visual C++ 2005

Sometimes debug build doesn’t crash but release build crashes. This usually happens when memory area which is not valid is accessed. Debug build usually has some fence around allocated memory area.
However, recently I suffered somewhat different case. In this case, you need to debug a release build.
Yeah.. It is quite easy. Just enable debug information [...]

Continue reading »

opening a process with SE_DEBUG_NAME privilege

To open a process successfully, the opener should be allowed in the DACL ( discretionary access control list ). So, I also tried adding an ACE, Access Control Entries, to the DACL. At least all who tried seem to think that way after reading MSDN documents. Yeah..
Then, this kind of code will be written.

HANDLE hProcess, hCommandEventLocal, hAllocationEventLocal;

BOOL isOK;
HANDLE hToken;

///////////////////////////////////////////////
// [...]

Continue reading »