During the past two days, I've been working (again) on my Boost Process library idea. While doing so, I realized that I don't know anything at all about coding for Windows using the MFC. I must learn how to handle processes under this platform to be able to design a correct abstraction layer for process management.

It's time to do so. I booted Windows XP, downloaded Borland's C++ Builder 5 command line tools (that is, the C++ free compiler) and installed it following the instructions (not a "trivial" task). Man, it's damn fast compared to GNU g++, as seen while building some Boost's code.

After this, I was was shown with the task to write a little Windows program. The only thing I knew was that they use a WinMain function rather than a main one, so this was the starting point. I looked for some documentation and finally came up with an extremely simple, useless and stupid command line program:

#include <windows.h>

int WINAPI
WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
return 0;
}

You see, all it does is return success. Building it was simple after some digging of the compiler options, but it took some time too. Doing bcc32.exe -tW test.cpp resulted in a test.exe file ready to be executed. I also tried some CreateProcess example I found, but I won't comment it yet since I still don't understand it perfectly.

I'll keep learning stuff during the following days, so expect more posts along the lines of this one. However, I don't know how much time I'll have to devote to Boost.Process: I applied for Google's summer of code, so in case I get picked, I'll have to work on my project rather than on anything else ;-)

Comments from the original Blogger-hosted post: