#include <windows.h>
class CBasicWindow
{
private:
HWND hHandle;
static LRESULT CALLBACK wndproc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch (uMsg)
{
case WM_DESTROY:
PostQuitMessage(0);
return true;
break;
default:
return DefWindowProc(hwnd,uMsg,wParam,lParam);
break;
}
}
public:
CBasicWindow(void):hHandle(0)
{
WNDCLASS wndclass;
ZeroMemory(&wndclass,sizeof(wndclass));
wndclass.style=CS_HREDRAW|CS_VREDRAW;
wndclass.lpszClassName =TEXT("window1");
wndclass.hbrBackground=(HBRUSH)(COLOR_BTNFACE+1);
wndclass.hInstance=GetModuleHandle(0);
wndclass.lpfnWndProc=(WNDPROC)wndproc;
if(!RegisterClass(&wndclass))
return ;
hHandle =CreateWindow(
TEXT("window1"),
TEXT("New Window"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
0,
0,
GetModuleHandle(0),
0);
if (!hHandle)
return;
}
void Show()
{
if (!hHandle)
ShowWindow(hHandle,SW_SHOW);
}
};
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
CBasicWindow cbwWindow;
cbwWindow.Show;
MSG msg;
while(GetMessage(&msg,0,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
</windows.h>
error C3867: 'CBasicWindow::Show': function call missing argument list; use '&CBasicWindow::Show' to create a pointer to member c:\documents and settings\...\test\main.cpp Line :64