Export (0) Print
Expand All

CreateHTMLPropertyPage Function

Creates a property page that displays HTML.

Syntax


HRESULT CreateHTMLPropertyPage(
    IMoniker *pmk,
    IPropertyPage **ppPP
);

Parameters

pmk
A pointer to an IMoniker interface from which the HTML for the property page is created.
ppPP
The address of a pointer to an IPropertyPage interface that receives the property page.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

To use CreateHTMLPropertyPage, which is implemented in Mshtml.dll, you must dynamically load and call this function by using the LoadLibrary function and the GetProcAddress function.

security note Security Alert  Using LoadLibrary incorrectly can compromise the security of your application by loading the wrong DLL. Refer to the LoadLibrary documentation for information on how to correctly load DLLs with different versions of Windows.

Example

The following example shows the basic steps to load Mshtml.dll, obtain the address of CreateHTMLPropertyPage using GetProcAddress, create a URL moniker, and call CreateHTMLPropertyPage.


    typedef HRESULT STDAPICALLTYPE CREATEHTMLPROPERTYPAGEFN (IMoniker *pmk, IPropertyPage **ppPP);

    HINSTANCE hinstMSHTML = LoadLibrary(TEXT("MSHTML.DLL"));

    if (hinstMSHTML == NULL)
    {
        //Error loading module -- fail as securely as possible
        return;
    }	
        
    CREATEHTMLPROPERTYPAGEFN* pfnCreateHTMLPropertyPage;
    pfnCreateHTMLPropertyPage = 
        (CREATEHTMLPROPERTYPAGEFN*)GetProcAddress( hinstMSHTML,
                                TEXT("CreateHTMLPropertyPage"));
    if (pfnCreateHTMLPropertyPage)
    {
        IMoniker *pURLMoniker;
        BSTR bstrURL = 
           SysAllocString(L"http://www.example.com/dialogsource.htm");
        CreateURLMoniker(NULL, bstrURL, &pURLMoniker);

        if (pURLMoniker)
        {
            IPropertyPage *pPropertyPage;
            (*pfnCreateHTMLPropertyPage)(pURLMoniker, &pPropertyPage);
    
            pURLMoniker->Release();
        }

        SysFreeString(bstrURL);
    }

    FreeLibrary(hinstMSHTML);

Function Information

Stock Implementation mshtml.dll
Custom Implementation No
Header mshtmhst.h
Import library mshtml.dll
Minimum availability Internet Explorer 4.0
Minimum operating systems Windows NT 4.0, Windows 95, Windows CE 4.0

See Also

Creating an HTML Resource

Community Additions

ADD
Show:
© 2014 Microsoft