求助sdk高手!!!
我用vc写一个sdk的小程序,源码如下
#include <windows.h>
#include "mouse.h"
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,
PSTR lpCmdLine,int nShowCmd)
{
MSG msg;
if(!InitApplication(hInstance))
return FALSE;
if(!InitInstance(hInstance,nShowCmd))
return FALSE;
while(GetMessage(&msg,hwnd,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
BOOL InitApplication(HINSTANCE hInstance)
{
WNDCLASS wc;
wc.style=CS_HREDRAW|CS_VREDRAW;
wc.lpfnWndProc=WndProc;
wc.cbClsExtra=0;
wc.cbWndExtra=0;
wc.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wc.hCursor=LoadCursor(NULL,IDC_CROSS);
wc.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wc.lpszMenuName=NULL;
wc.lpszClassName=szAppName;
return RegisterClass(&wc);
}
BOOL InitInstance(HINSTANCE hInstance,int nShowCmd)
{
hwnd=CreateWindow(szAppName,szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,
CW_USEDEFAULT,CW_USEDEFAULT,
NULL,NULL,hInstance,NULL);
if(!hwnd)
return FALSE;
ShowWindow(hwnd,nShowCmd);
UpdateWindow(hwnd);
return TRUE;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
int x,y;
HDC hdc;
switch(message)
{
case WM_LBUTTONDOWN:
hdc=GetDC(hwnd);
x=LOWORD(lParam);
y=HIWORD(lParam);
TextOut(hdc,x,y,TEXT("您点击了鼠标左键"),lstrlen(TEXT("您点击了鼠左键")));
ReleaseDC(hwnd,hdc);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hwnd,message,wParam,lParam);
}
PSTR IntToStr(int i)
{
TCHAR szBuffer[20];
wsprintf(szBuffer,TEXT("%10d"),i);
return szBuffer;
}
头文件mouse.h如下
TCHAR szAppName[]=TEXT("Mouse");
HWND hwnd;
PSTR IntToStr(int);
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
BOOL InitApplication(HINSTANCE);
BOOL InitInstance(HINSTANCE,int);
编译、连接都没报错,但执行就会出现以下提示:
Loaded 'D:\WINNT\System32\ntdll.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\user32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\kernel32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\gdi32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\imm32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\advapi32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\rpcrt4.dll', no matching symbolic information found.
The thread 0x6E8 has exited with code 0 (0x0).
The program 'D:\xiaofeng源码\VC练习\mouse\Debug\mouse.exe' has exited with code 0 (0x0).
请问各位大侠是何原因???