I've got a ATL/COM dll that has an icon: IDI_RED. I used this icon in the
dialog editor and it works. Now I want to load it with:
AfxGetApp()->LoadIcon(IDI_RED);
but it fails. When I trace inside it seems that a call to MAKEINTRESOURCE
returns 0x00000e = "" as string. This seems really strange. Any ideas?
Thank you,
Gernot
__________________________
DREAM DESIGN ENTERTAINMENT
http://www.Dream-D-Sign.de
__________________________
icon=LoadIcon(NULL, MAKEINTRESOURCE(IDI_RED));
returns this error:
1813 The specified resource type cannot be found in the image file.
ERROR_RESOURCE_TYPE_NOT_FOUND
Has this to do with ATL and / or DLL instead of usual exe program?
Thank you,
Gernot
... and this works!
icon = ((CStatic*)(GetDlgItem(IDC_STATIC_RED)))->GetIcon();
Ah - come on! What is going on here? I'm really desperated now.
Gernot.
Check the HINSTANCE parameter to LoadIcon. NULL refers to the main EXE;
anything else refers to a particular DLL. You obtain the HINSTANCE to your
DLL in DllMain, or through the _Module object in ATL
(_Module.GetResourceInstance() works).
--
Tim Robinson
http://www.themoebius.org.uk/
Also I've got a problem: when I close the dialog, which I inserted
afterwards in my ATL Dll (using CMyDlg d; d.DoModal()) after the window
closes the function CDialog::DestroyWindow fails here:
ASSERT(m_hWnd == hWndOrig);
But when I compile a release version it does not make any difference - so
why bother. But it would be nice if you know a solution to this as well...
Anyway thank you very very much,
Gernot.
"Tim Robinson" <t...@gaat.freeserve.co.uk> schrieb im Newsbeitrag
news:ajakpg$19km6b$1...@ID-103400.news.dfncis.de...