From: virgin AT nuernberg DOT netsurf DOT de (VirGin) Subject: Newbie would like some help... 5 Jun 1997 10:17:08 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <33965E92.86714CF0.cygnus.gnu-win32@nuernberg.netsurf.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Mailer: Mozilla 4.0b5 [en] (Win95; I) Original-To: "gnu-win32 AT cygnus DOT com" X-Priority: 3 (Normal) Original-Sender: owner-gnu-win32 AT cygnus DOT com HiHiHi, I am new to the discussion group. It seems as though I joined a day too late. I recently got 1.8 of the gnuwin c/c++/etc compiler. I want to learn to write programs for win95/NT. My first program, which was supposed to create a window and display some text, did not finish compiling. The linker did not like the calls I made to create the window. I am at a loss for what is going on. The code is at the end of this message, after mine failed, I copied one from a book which also failed. I have several good books about win95/nt programming, but I do not know how compliant the gnu libraries are with the microsoft classes. The linker reports that I make undefined calls and then aborts with an error code 1. What is that?? Are there any sites which have good docs regarding the gnuwin32 libraries?? Thanx for your help. the code, copied from a book... // I do not even know if it will compile with the gcc tools. #include // prototype declaration int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pszCmdLine, int nCmdShow ); LRESULT CALLBACK WindowProc( HWND hWnd, UINT uMsgId, WPARAM wParam, LPARAM lParam ); // Winmain is where all the action is int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pszCmdLine, int nCmdShow ) { static char szAppName[] = "test-dummy"; HWND hWnd; MSG msg; WNDCLASS wndClass; wndClass.style = 0; wndClass.lpfnWndProc = WindowProc; wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; wndClass.hInstance = hInstance; wndClass.hIcon = LoadIcon(NULL,IDI_APPLICATION); wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); wndClass.hbrBackground = GetStockObject(WHITE_BRUSH); wndClass.lpszMenuName = NULL; wndClass.lpszClassName = szAppName; if (RegisterClass(&wndClass) == 0) { return 0; } hWnd = CreateWindow( szAppName, szAppName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); if (hWnd == 0) { return 0; } ShowWindow(hWnd, nCmdShow); UpdateWindow (hWnd); while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LRESULT CALLBACK WindowProc( HWND hWnd, UINT uMsgId, WPARAM wParam, LPARAM lParam ) { static char *pszHello = "Hello "; switch (uMsgId) { case WM_PAINT: HDC hDC; PAINTSTRUCT paintStruct; hDC = BeginPaint(hWnd, &paintStruct); TextOut(hDC, 0, 0, pszHello, lstrlen(pszHello)); EndPaint(hWnd, &paintStruct); return 0; case WM_DESTROY: PostQuitMessage(0); return 0; default: return DefWindowProc(hWnd, uMsgId, wParam, lParam); } } - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".