none
请大神帮我看看这段代码有什么问题,谢谢 RRS feed

  • 问题

  • BOOL CALLBACK dlgFunc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
    {
    	switch (uMsg)
    	{
    	case WM_COMMAND:
    		{
    		switch(wParam)
    		{
    		case IDCANCEL:
    			{
    				EndDialog(hwndDlg,IDCANCEL);
    			}break;
    		case IDOK:
    			{
    			int nLEFT = GetDlgItemInt(hwndDlg,IDCL,NULL,TRUE);
    			int nRIGHT = GetDlgItemInt(hwndDlg,IDCR,NULL,TRUE);
    			SetDlgItemInt(hwndDlg,IDCJIAGUO,LEFT - RIGHT,TRUE);
    			}break;	
    		}	
    		}break;
    	}
    	return FALSE;
    
    }
    int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow) 
    {
    	//DialogBox(hInstance,(LPCTSTR)DG,NULL,dlgFunc);
    	DialogBox(hInstance,(LPCTSTR)ID1,NULL,dlgFunc);
    
    	return 0;
    }

    2018年2月18日 2:23

答案

  • DialogBox(hInstance,(LPCTSTR)ID1,NULL,dlgFunc);
    --->
    DialogBox(hInstance,MAKEINTRESOURCE(ID1),NULL,dlgFunc);

    Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.

    • 已标记为答案 2422645737 2018年2月20日 10:30
    2018年2月19日 13:50
    版主