我编写C++调用MessageBox是报错,还请各位多多帮助!
#include<windows.h>__stdcallWinMain(HINSTANCEhinstance,HINSTANCEjprevinstance,LPSTRlp...
#include<windows.h>
__stdcall WinMain(HINSTANCE hinstance,HINSTANCE jprevinstance,LPSTR lpComLine,int nCmdShow)
{
typedef (WINAPI *lpMessageBox)(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType);
HINSTANCE hDll;
hDll = LoadLibrary("user32.dll");
lpMessageBox Msg;
Msg = (lpMessageBox) GetProcAddress(hDll,'MessageBoxA');
// Msg(NULL,TEXT("开始学Window编程!"),TEXT("消息!"),MB_OK);
return 0;
}
C:\new_temp\新建文件夹\MessageBox\Cpp2.cpp(10) : error C2015: too many characters in constant 展开
__stdcall WinMain(HINSTANCE hinstance,HINSTANCE jprevinstance,LPSTR lpComLine,int nCmdShow)
{
typedef (WINAPI *lpMessageBox)(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType);
HINSTANCE hDll;
hDll = LoadLibrary("user32.dll");
lpMessageBox Msg;
Msg = (lpMessageBox) GetProcAddress(hDll,'MessageBoxA');
// Msg(NULL,TEXT("开始学Window编程!"),TEXT("消息!"),MB_OK);
return 0;
}
C:\new_temp\新建文件夹\MessageBox\Cpp2.cpp(10) : error C2015: too many characters in constant 展开
2个回答
展开全部
Msg = (lpMessageBox) GetProcAddress(hDll,'MessageBoxA');
第二个参数有问题,第二个参数为LPCSTR,改成
Msg = (lpMessageBox) GetProcAddress(hDll,"MessageBoxA");
第二个参数有问题,第二个参数为LPCSTR,改成
Msg = (lpMessageBox) GetProcAddress(hDll,"MessageBoxA");
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询