Geoff Chappell - Software Analyst
HRESULT ShowModelessHTMLDialog ( HWND hwndParent, IMoniker *pMk, VARIANT *pvarArgIn, VARIANT *pvarOptions, IHTMLWindow2 **ppWindow);
The work of the ShowModelessHTMLDialog function is essentially that of ShowHTMLDialogEx with HTMLDLG_MODELESS as its only set flag, with the following differences:
Put another way, the sequences contrasted in the following table are equivalent in practice:
CoInitialize (NULL); hr = ShowModelessHTMLDialog ( hwndParent, pMk, pvarArgIn, pvarOptions, ppWindow); CoUninitialize ();
VARIANT out; hr = ShowHTMLDialogEx ( hwndParent, pMk, HTMLDLG_MODELESS, pvarArgIn, pvarOptions -> bstrVal, &out); *ppWindow = out.punkVal;
The ShowModelessHTMLDialog function is exported from MSHTML by name in versions 5.00 and higher. The function is documented, though is somehow said to have Internet Explorer 4.0 listed as its minimum availability.
The Windows SDK provides a prototype in the MSHTMHST.H header file, but it is not immediately useful to programmers because the SDK does not supply any import library for resolving a natural call to the function. Instead, the SDK tells programmers to write some supporting code that uses LoadLibrary to load MSHTML.DLL, and GetProcAddress to locate the function, and then the helpfully provided type SHOWMODELESSHTMLDIALOGFN for an indirect call to the function. This is all plainly silly and anyone who anticipates doing this work more than once would obviously do better to synthesise the missing import library.