Re: error on CreateDialog
- From: "CheckAbdoul" <checkabdoul at mvps dot org>
- Date: Tue, 11 Oct 2005 16:47:59 -0400
I believe you have to change the .rc file to add the CLASS item in the
dialog resource. See
http://support.microsoft.com/?id=251059
How to provide your own Window class name for an MFC dialog box
BTW, this is not the correct newsgroup for SDK questions. Next time
try microsoft.public.vc.mfc newsgroup.
--
Cheers
Check Abdoul
-----------------
"hyf" <hyf.1wqchn@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:hyf.1wqchn@xxxxxxxxxxxxxxxxxxxxxxxx
>
> 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;
> }
>
>
>
> --
> hyf
> ------------------------------------------------------------------------
> Posted via http://www.codecomments.com
> ------------------------------------------------------------------------
>
.
- Prev by Date: Re: A question about EngCopyBits
- Next by Date: Re: problem of providing my own version of malloc/free
- Previous by thread: Re: error on CreateDialog
- Next by thread: Re: error on CreateDialog
- Index(es):
Relevant Pages
|