Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual C++
ATL
ATL Functions
 AtlAxCreateControl

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
ATL Library Reference
AtlAxCreateControl

Creates an ActiveX control, initializes it, and hosts it in the specified window.

ATLAPI AtlAxCreateControl(
   LPCOLESTR lpszName,
   HWND hWnd,
   IStream* pStream,
   IUnknown** ppUnkContainer 
);
lpszName

A pointer to a string to be passed to the control. Must be formatted in one of the following ways:

  • A ProgID such as "MSCAL.Calendar.7"

  • A CLSID such as "{8E27C92B-1264-101C-8A2F-040224009C02}"

  • A URL such as "http://www.microsoft.com"

  • A reference to an Active document such as "file://\\Documents\MyDoc.doc"

  • A fragment of HTML such as "MSHTML:<HTML><BODY>This is a line of text</BODY></HTML>"

    NoteNote:

    "MSHTML:" must precede the HTML fragment so that it is designated as being an MSHTML stream.

hWnd

[in] Handle to the window that the control will be attached to.

pStream

[in] A pointer to a stream that is used to initialize the properties of the control. Can be NULL.

ppUnkContainer

[out] The address of a pointer that will receive the IUnknown of the container. Can be NULL.

One of the standard HRESULT values.

This global function gives you the same result as calling AtlAxCreateControlEx( lpszName, hWnd, pStream, NULL, NULL, NULL, NULL );.

To create a licensed ActiveX control, see AtlAxCreateControlLic.

Header: atlhost.h

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker