The error code is 6 with GetLastError£¨£©£¬
First i registered a WNDCLASS£¬then I create a dialog¡£
But it failed¡£
My intent is to add an icon for the dialog in a dll.
Someone can help me?
Thanks.
Code:
wc.style = CS_HREDRAW | CS_VREDRAW ;
wc.lpfnWndProc = (WNDPROC)WndProc ;//callback procedure
wc.cbClsExtra = 0 ;
wc.cbWndExtra = DLGWINDOWEXTRA ;
wc.hInstance = tmp_hModule ;
//dllmain input handle when attach process
wc.hIcon = LoadIcon(tmp_hModule, MAKEINTRESOURCE(IDI_ICON1));
wc.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wc.hbrBackground = GetStockObject (LTGRAY_BRUSH) ;
wc.lpszMenuName = NULL ;
wc.lpszClassName = szAppName;
//defined as TCHAR szAppName[] = TEXT("OPERATIONPANEL");
if(!RegisterClass(&wc)) return FALSE ;
hwnd=CreateDialog(tmp_hModule,MAKEINTRESOURCE(IDD_TABLEDLG),0,WndProc);
if(hwnd==NULL)
{
error=GetLastError();
wsprintf(str,L"error=%d",GetLastError());
MessageBox(NULL,str,L"CreateDialog",MB_OK);
return FALSE;
-
hy
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------