Location: Symbol Reference > Functions > JwCoCreateInstanceAsEx Function
JWSCL Documentation
ContentsIndexHome
PreviousUpNext
JwCoCreateInstanceAsEx Function
Pascal
function JwCoCreateInstanceAsEx(const MonikerSequence: WideString; const ParentWindowHandle: HWND; const ClassId: TGUID; const IID: TGUID; out ObjectInterface): HRESULT;
Parameters 
Description 
const MonikerSequence: WideString 
defines a string that contains information how to use the moniker  
const ParentWindowHandle: HWND 
defines the window handle that is used to display the elevation dialog. If this parameter is 0 or the window is has not the input the elevation dialog will not be shown but a new task is displayed it the taskbar. Otherwise the elevation dialog will be shown direclty.  
const ClassId: TGUID 
defines a guid that describes a registered com object  
const IID: TGUID 
defines the requested com object to be returned  
out ObjectInterface 
returns the requested and elevated com object  

Returns a COM result code. If the call was successfull the return value is S_OK

JwCoCreateInstanceAsEx creates an out of process COM object and returns it in ObjectInterface. If the current is already elevated, the function just creates an COM object and returns it; otherwise the elevation dialog will be shown. 

The COM class must be registered in a COM type library. The executable which call this function must contain a manifest that defines "asInvoker" as the requested execution level.

<requestedExecutionLevel level="asInvoker"/>

 

This function needs CoInitialize to be called. This function only works on Windows Vista and newer OS versions. 

 

Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.
What do you think about this topic? Send feedback!