Compartilhar via


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

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

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 Warning: 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.

Examples

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);

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mshtmhst.h

DLL

Mshtml.dll; Mshtml.dll

See also

Creating an HTML Resource