CoCreateInstance function Null safety ole32
- Pointer<
GUID> rclsid, - Pointer<
NativeType> pUnkOuter, - int dwClsContext,
- Pointer<
GUID> riid, - Pointer<
Pointer< ppvNativeType> >
Creates a single uninitialized object of the class associated with a specified CLSID. Call CoCreateInstance when you want to create only one object on the local system. To create a single object on a remote system, call the CoCreateInstanceEx function. To create multiple objects based on a single CLSID, call the CoGetClassObject function.
HRESULT CoCreateInstance(
REFCLSID rclsid,
LPUNKNOWN pUnkOuter,
DWORD dwClsContext,
REFIID riid,
LPVOID *ppv
);
Implementation
int CoCreateInstance(Pointer<GUID> rclsid, Pointer pUnkOuter, int dwClsContext,
Pointer<GUID> riid, Pointer<Pointer> ppv) {
final _CoCreateInstance = _ole32.lookupFunction<
Int32 Function(Pointer<GUID> rclsid, Pointer pUnkOuter,
Uint32 dwClsContext, Pointer<GUID> riid, Pointer<Pointer> ppv),
int Function(Pointer<GUID> rclsid, Pointer pUnkOuter, int dwClsContext,
Pointer<GUID> riid, Pointer<Pointer> ppv)>('CoCreateInstance');
return _CoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv);
}