Free CSG Example
Click here to go to the CSG example
http://au.ebid.net/perl/normal.cgi?ref=855501&mo=register-main

How to compile a Win32 API program in BCB



(note that I have done this for the trial version of BCB and may not be necessary for later versions)

When you first go to compile a Win32 API program in Borland's C++ Builder you may run into a few problems. The first problem is the lack of documentation; after all, how many Visual Studios would be sold if they also explained how to hand code your own windows. The second problem is the automatic creation of a Form and a project file which is irremovable.

To save anyone else having to ponder this problem, which is easily solved when you know how, what you do is...

Go to file/new and choose a console app. Then go to options/project/linker and choose Window GUI where it says application type. Next go to the source and delete it ALL and replace it with your Win32 API code. Now build all and your done.

Al.

To test it out, here's some Win32 API code...

#include <windows.h>

int WINAPI WinMain(
  HINSTANCE hInstance,
  HINSTANCE hInstPrev,
  LPSTR lpszCmdLine,
  int nCmdShow)
{
  return MessageBox(HWND_DESKTOP,"Hello World","Made with BCB",MB_OK|MB_ICONINFORMATION);
}
 


Copyright © 1998 - 2010 Alan Baylis, All Rights Reserved