I have a plain Win32 App in which I'm trying to display an HTML resource
using ShowHTMLDialog. It works okay, but it does not apply the window
ornaments that I specify in 4th argument of ShowHTMLDialog, pchOptions. I
specify the dialog window size and make it resizeable. Would someone take a
look at my code and tell me what I'm doing wrong.
HINSTANCE hMsHtmlDll = LoadLibrary(TEXT("MSHTML.DLL"));
if(hMsHtmlDll)
{
SHOWHTMLDIALOGFN *pfnShowHTMLDialog;
pfnShowHTMLDialog = (SHOWHTMLDIALOGFN*)GetProcAddress(hMsHtmlDll,
"ShowHTMLDialog");
if(pfnShowHTMLDialog)
{
IMoniker *pMoniker;
char szTemp[MAX_PATH*2];
OLECHAR bstr[MAX_PATH*2];
strcpy(szTemp, TEXT("res://"));
GetModuleFileName(hInst, szTemp + lstrlen(szTemp),
(sizeof(szTemp)/sizeof(szTemp[0])) - lstrlen(szTemp));
sprintf(&szTemp[strlen(szTemp)], "/%d", IDR_HTML_HELP);
bstr[0] = 0;
MultiByteToWideChar(CP_ACP, 0, szTemp, -1, bstr,
sizeof(bstr)/sizeof(bstr[0]));
CreateURLMoniker(NULL, bstr, &pMoniker);
if(pMoniker)
{
strcpy(szTemp, "resizeable:yes; dialogWidth:640px; dialogHeight:480px;");
// szTemp IS BEING IGNORED HERE. WHAT'S WRONG?
(*pfnShowHTMLDialog)(hWndMain, pMoniker, NULL, szTemp, NULL);
pMoniker->Release();
}
}
FreeLibrary(hMsHtmlDll);
}
Thorsten Albers - 22 Sep 2008 23:47 GMT
rhardy <rhardy@discussions.microsoft.com> schrieb im Beitrag
<B208ED32-146C-4757-BF06-A537EF476350@microsoft.com>...
> Would someone take a look at my code and tell me what I'm doing wrong.
Your code is C/C++ code - but this newsgroup is for MS Visual Basic <= 6
aka 'classic' only. Please ask your question in a newsgroup dealing with
C/C++ coding of which there are plenty on the net.
Be aware of the fact that with questions regarding C/C++ and the Windows
API usually you don't have to search a special group for Windows API coding
but may ask your question in a 'normal' C/C++ group since C/C++ coding for
Windows without using the Windows API is nearly impossible.

Signature
----------------------------------------------------------------------
Thorsten Albers albers(a)uni-freiburg.de
----------------------------------------------------------------------