Hi,

I created a resource-only Dll to store string, dialog, icon and bitmap. With
loadstring function i can load a string from this dll, but i don't know how
dipslay a dialog from it. here is my code :

UINT CDataResource::GetResourceDialog(int ResourceID)
{
// load resource
LPCDLGTEMPLATE lpDialogTemplate = NULL;
HGLOBAL hDialogTemplate = NULL;
HINSTANCE hInst = AfxFindResourceHandle(MAKEINTRESOURCE(ResourceID),
RT_DIALOG);
HRSRC hResource = ::FindResource(hInst, MAKEINTRESOURCE(ResourceID),
RT_DIALOG);
hDialogTemplate = LoadResource(hInst, hResource);
if (hDialogTemplate != NULL)
lpDialogTemplate = (LPCDLGTEMPLATE)LockResource(hDialogTemplate);
else
return 0;

ASSERT(lpDialogTemplate != NULL);


// HERE I WANT TO DISPLAY MY DIALOG


// free resource
UnlockResource(hDialogTemplate);
FreeResource(hDialogTemplate);

return 1;
}


Thanks in advance

Re: I need to display a dialog from a resource -only DLL by William

William
Wed Jul 30 10:20:27 CDT 2003

"Cheickna Traoré" <cheickna.traore@almas.fr> wrote in message
news:bg8ind$cur$1@s1.read.news.oleane.net...
> I created a resource-only Dll to store string, dialog, icon and bitmap.
With
> loadstring function i can load a string from this dll, but i don't know
how
> dipslay a dialog from it. here is my code :

At the level of the Win32 API, once you have a dialog box template in memory
all you need to do is call

::DialogBoxIndirectParam()

specifying the pointer to the template as its second parameter. You might
want to post again in an MFC group for how best to to this with the class
library.

Regards,
Will