Example lrc_Create_InstanceExCreating Instances

Creates an instance of an object on a remote machine and can return multiple interfaces.

HRESULT lrc_CreateInstanceEx( char *clsidStr, Iunknown *pUnk, DWORD dwClsCtx, ...);
*clsidStr A pointer to the CLSID string of the object to be created.
*pUnk When non-NULL, indicates the instance is being created as part of an aggregate, and punkOuter is to be used as the new instance's controlling IUnknown. Aggregation is currently not supported cross-process or cross-machine. When instantiating an object out of process, CLASS_E_NOAGGREGATION will be returned if pUnk is non-NULL.
dwClsCtx Context in which the code that manages the newly created object will run. The values are taken from the enumeration CLSCTX and refer to in-process, local, remote or combinations of these.

Additional Arguments

*pServerInfo Args Pointer to arguments in place of pServerInfo. In the original Microsoft definition, pServerInfo is a structure giving Information about the computer on which to instantiate the object. VuGen breaks up the structure into a series of parameters separated by keywords: IDENTITY, INFO and REMOTEMACHINE. If these arguments are omitted, the object is instantiated on the local computer or at the computer specified in the registry under the class's RemoveServerName named value, according to the interpretation of the dwClsCtx parameter.
*pResults Args Pointer to arguments in place of pResults. In the original Microsoft definition, pResults is a structure with a list of interfaces. VuGen breaks up the structure into a series of parameter triplets. Each triplet contains the identifier for a requested interface (pIID), the location to return the interface pointer(pItf) and flag for checking errors as in __CheckResult). If the call returns an interface for the GUID, then VuGen will write the name of that interface when it generates the script. However, if the GUID is unrecognized on the remote machine, then VuGen will write "dummy" when it generates the script.

__CheckResult This flag is generated by VuGen to indicate if the call was successful when the script was generated and HRESULT should be checked. Values: CHECK_HRES or DONT_CHECK_HRES.

The lrc_CreateInstanceEx function creates an uninitialized object on a designated remote machine, and can return any number of requested interfaces.

This function returns HRESULT. You can use this return value in code that you write, but VuGen processes it internally and does not show it in scripts. Consult Microsoft documentation for further details.

Return Values

lrc Return Values


You cannot use standard parameterization for any arguments in this function.