Originally posted by Fool
I am using the Dev C++ compiler and when I try and use a Window app to write code to it starts me off with a long list of code already. Now my question is where do I start to write my code? I can send the source over email if you'd like to see it.
-Fool
Most of that code is used to create a window. A lot of
code...
Your code goes in the WinMain function. Here's a simple
program that doesn't have a created-window. You can see
how small it is compared to a program that has a window..
(Eh, am I making sense?)
Code:
//Simple message-box program
#include <windows.h>
#include <windowsx.h>
int WINAPI WinMain(HINSTANCE hinstance,
HINSTANCE hprevinstance,
LPSTR lpcmdline,
int ncmdshow)
{
//Code goes here. Window isn't created for this program.
//Just a message box.
MessageBox(NULL, "Hello Fool!", "A message box",MB_OK);
return 0;
}
Anyway, do what Govtcheez said. Start programming console-
apps first. Most C/C++ books teach that first anyway.
Goodbye