|
OleCreateDefaultHandler
Creates a new instance of the default embedding handler. This instance is
initialized so it creates a local server when the embedded object enters the
running state.
HRESULT OleCreateDefaultHandler(
REFCLSID clsid,
| //Identifies OLE server to be loaded
| LPUNKNOWN pUnkOuter,
| //Controlling unknown if aggregated; else NULL
| REFIID riid,
| //Interface for communicating with handler
| LPVOID FAR *lplpvObj
| //Receives pointer to interface on handler
| );
|
|
Parameters
clsid
Specifies CLSID identifying the OLE server to be loaded when the embedded
object enters the running state.
pUnkOuter
Points to the controlling IUnknown interface if the handler is to be aggregated; NULL if it is not to be
aggregated.
riid
Specifies the interface, usually IID_IOleObject, through which the caller will communicate with the handler.
lplpObj
On return, receives a pointer to the interface requested in riid on the newly created handler.
Return Values
E_OUTOFMEMORY
Indicates a handler cannot be created because the system is out of memory
NOERROR
Indicates the creation operation was successful.
Comments
OleCreateDefaultHandler creates a new instance of the default embedding handler, initialized so it
creates a local server identified by the clsid parameter when the embedded object enters the running state.
If the given object definition does not have a special handler, a call to OleCreateDefaultHandler produces the same results as a call to the CoCreateInstance function with the class context parameter assigned the value
CLSCTX_INPROC_HANDLER.
When to Use
If you are writing a handler and want to use the services of the default
handler, call OleCreateDefaultHandler. OLE also calls it internally when the CLSID specified in an object creation
call is not registered.
See Also
CoCreateInstance, CLSCTX
Related LinksSoftware for Delphi and C++ Builder developers Software for Visual Studio .NET developers Software for Visual Basic 6 developers Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps Win32 Programmer's Reference (win32.hlp) Win32 Multimedia Programmer's Reference (mmedia.hlp) Microsoft Windows Pen API Programmer's Reference (penapi.hlp) Microsoft Windows Sockets 2 Reference (sock2.hlp) Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp) Unix Manual Pages
|