感觉以下用法挺老的了,不知道是在什么书上看到的 hInstance=((LPCREATESTRUCT)lParam)->hInstance; ///关于对话框 lpfnAboutDlgProc=MakeProcInstance((FARPROC)AboutDlgProc,hInstance); //查询对话框 lpfnAboutDlgProc=MakeProcInstance((FARPROC)FindDlgProc,hInstance); 关于:MakeProcInstance The MakeProcInstance function is obsolete. Win32 functions can be called directly. This function is provided only for compatibility with 16-bit versions of Windows. Win32-based applications should not use this function.
HINSTANCE hInst =NULL;
//在winmain中,
hwnd=CreateWindow........
hInst = hInstance;//加上这句
//在主窗口过程中
.........
case 105:////关于对话框
MessageBeep(0);
//DialogBox((HINSTANCE__ *)hInstance,MAKEINTRESOURCE(102),
//hwnd, (DLGPROC)lpfnAboutDlgProc);
DialogBox(hInst, (LPCTSTR)102, hWnd, (DLGPROC)lpfnAboutDlgProc);
//return 0;
break; //用这个习惯点:)case 40003://///查询对话框
MessageBeep(0);
//DialogBox((HINSTANCE__ *)hInstance,"#103",
// hwnd,(DLGPROC)lpfDlgProc);
DialogBox(hInst, (LPCTSTR)#103, //你上面的#103是什么意思?
//对话框的ID吗?反正这里就应该是啦
hWnd, (DLGPROC)lpfDlgProc);
//return 0;
break;
DialogBox(hInst, (LPCTSTR)102, hWnd, (DLGPROC)AboutDlgProc);
DialogBox(hInst, (LPCTSTR)#103, //你上面的#103是什么意思?
//对话框的ID吗?反正这里就应该是啦
hWnd, (DLGPROC)FindDlgProc);
hInstance=((LPCREATESTRUCT)lParam)->hInstance;
///关于对话框
lpfnAboutDlgProc=MakeProcInstance((FARPROC)AboutDlgProc,hInstance);
//查询对话框
lpfnAboutDlgProc=MakeProcInstance((FARPROC)FindDlgProc,hInstance);
关于:MakeProcInstance
The MakeProcInstance function is obsolete. Win32 functions can be called directly. This function is provided only for compatibility with 16-bit versions of Windows. Win32-based applications should not use this function.