Subject: Simple windows program won't compile
From: [email-masked] (theace)

30 May 1997 11:26:03 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="------------8FF23694039500A1C52CB538"
X-Mailer: Mozilla 4.0b3 [en] (Win95; I)
Original-To: [email-masked]
X-Priority: 3 (Normal)
Original-Sender: [email-masked]

This is a multi-part message in MIME format.
--------------8FF23694039500A1C52CB538
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

   Hello. I have a little problem that I was hoping someone could help
with. I can not figure out why the following program won't compile
without errors. If you don't see anything wrong with it, could you try
compiling it and see if you have problems? Thank you.

Begin Program:

--------------8FF23694039500A1C52CB538
Content-Type: text/plain; charset=us-ascii; name="test1.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="test1.txt"

#include <windows.h>

LRESULT CALLBACK MyFunc(HWND, UNIT, WPARAM, LPARAM);

char szWinName[] = "MyWin";

int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst, LPSTR lpszArgs, int nWinMode)
{
 HWND hwnd;
 MSG msg;
 WNDCLASS wcl;

 wcl.hInstance = hThisInst;
 wcl.lpszClassName = szWinName;
 wcl.lpfnWndProc = MyFunc;
 wcl.style = 0;
 wcl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
 wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
 wcl.lpszMenuName = NULL;

 wcl.cbClsExtra = 0;
 wcl.cbWndExtra = 0;

 wcl.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);

 if(!RegisterClass(&wcl)) return 0;

 hwnd = CreateWindow(szWinName, "Windows 95 Skeleton", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hThisInst, NULL);

 ShowWindow(hwnd, nWinMode);
 UpdateWindow(hwnd);

 while(GetMessage(&msg, NULL, 0, 0))
 {
  TranslateMessage(&msg);
  DispatchMessage(&msg);
 }

 return msg.wParam;

}

LRESULT CALLBACK MyFunc(HWND hwnd,UNIT message, WPARAM wParam, LPARAM lParam)
{
 
 switch(message) 
 {
   case WM_DESTROY:
    PostQuitMessage(0);
    break;
   default:
    return DefWindowProc(hwnd, message, wParam, lParam);

 }

 return 0;

}

--------------8FF23694039500A1C52CB538--

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".