我用vc6.0编译的时候老是出一个错误。error C2664: 'CreateDialogParamA' : cannot convert parameter 4 from 'long (struct HWND__ *,unsigned int,unsigned int,long)' to 'int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'出错的代码是 LRESULT CALLBACK DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
g_hDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);CreateDialog();可能是因为这个函数最后一个参数的类型是DLGPROC,跟LRESULT不是一样,但是我还有一个程序也是这样的怎么就能通过,我看了一下两个程序的区别,另一个程序比这个程序多一个文件夹External Dependencies,里面有一个basets.h和resourse.hm,我猜可能是这里的原因,我上网查说这个文件夹External Dependencies是编译时自动生成的,但是我的怎么就无法生成呢,我换了一个绿色免安装的VC6.0也不行。而且两个VC都无法file->open,这是哪里出了问题啊 还望高手指点,是软件问题还是文件配置问题,还是其他什么问题
g_hDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);CreateDialog();可能是因为这个函数最后一个参数的类型是DLGPROC,跟LRESULT不是一样,但是我还有一个程序也是这样的怎么就能通过,我看了一下两个程序的区别,另一个程序比这个程序多一个文件夹External Dependencies,里面有一个basets.h和resourse.hm,我猜可能是这里的原因,我上网查说这个文件夹External Dependencies是编译时自动生成的,但是我的怎么就无法生成呢,我换了一个绿色免安装的VC6.0也不行。而且两个VC都无法file->open,这是哪里出了问题啊 还望高手指点,是软件问题还是文件配置问题,还是其他什么问题
The DialogProc function is an application-defined callback function used with the CreateDialog and DialogBox families of functions. It processes messages sent to a modal or modeless dialog box. The DLGPROC type defines a pointer to this callback function. DialogProc is a placeholder for the application-defined function name. SyntaxINT_PTR CALLBACK DialogProc( HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
ParametershwndDlg
[in] Handle to the dialog box.
uMsg
[in] Specifies the message.
wParam
[in] Specifies additional message-specific information.
lParam
[in] Specifies additional message-specific information.
最好看下MSDN