Skip to main content
GameDev.net gamedev.net
🔒 Locked

what is the problem whit my code

Started by cpp boy Jun 2, 2002 at 10:33 AM 10 replies 350+ views
Original Post
cpp boy
cpp boy
OK here my code and yes i did an windows32 api project and all linked stuff o and i got visual c++ 6.0 soo here the code. #include <windows.h> #include <stdio.h> LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hwnd; MSG msg; WNDCLASSEX wc; wc.cbSize = sizeof(wc); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = "Window Class1"; wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); RegisterClassEx(&wc); hwnd = CreateWindow ("Window Class 1" "My First Window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); while (GetMessage(& msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch(Msg) { case WM_CREATE: break; case WM_SIZE: break; case WM_PAINT: break; case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hWnd, Msg, wParam, lParam); } and here is the error i get Compiling... win main.cpp C:\Windows\Bureau\dump\c++\My project\windows 32 api\prj1\win main.cpp(46) : warning C4003: not enough actual parameters for macro ''CreateWindowA'' C:\Windows\Bureau\dump\c++\My project\windows 32 api\prj1\win main.cpp(46) : error C2059: syntax error : '')'' Error executing cl.exe. Please tell me what i have to do because before i was doing windows32 api and all went well do i have to reinstall Kevin
Kevin
MrSelfDestruct
MrSelfDestruct
Have you tried using CreateWindowEx() instead of CreateWindow()?
cpp boy
cpp boy
um sorry can you tell me what is a comma bye showing me one

Kevin
Kevin
invective
invective
une "comma" est une virgule

Vous avez besoin d''une virgule entre les deux "strings":


hwnd = CreateWindow ("Window Class1", //mettez une virgule ici
"My First Window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);


cpp boy
cpp boy
thank for all your help people i really apriciate

Kevin
Kevin
Omaha
Omaha
You have GOT to be kidding me...
cpp boy
cpp boy
why
Kevin
Qw3r7yU10p!
Qw3r7yU10p!
he''s from canada

not everyone is english speaking. go easy.
cpp boy
cpp boy
pete wood you understand me like im your brother. Im from canada and im truly french. But i know my english well but not like you guys

Kevin
Kevin

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.