Freigeben über


IViewProviderFactory::CreateViewProvider method

Allows an application to register a handler for tile launch activation.

Syntax

HRESULT CreateViewProvider(
  [out, retval] IViewProvider **viewProvider
);

Parameters

  • viewProvider [out, retval]
    Type: IViewProvider**

    A view provider that represents a view created as a result of this call.

Return value

Type: HRESULT

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

Examples

class CMyViewProvider : public RuntimeClass< FtmBase, IViewProviderFactory>
{
    HRESULT CreateViewProvider(__in HSTRING, __deref_out IViewProvider** viewProvider)
    {
        ComPtr<IViewProvider> spViewProvider = Make<CMyApplicationView>();
        if (spViewProvider)
        {
            *viewProvider = spViewProvider.Detach();
            return S_OK;
        }
        else
        {
            return E_OUTOFMEMORY;
        }
    }
}

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Header

Windows.ApplicationModel.Core.h

IDL

Windows.ApplicationModel.Core.idl

See also

IViewProviderFactory