<DllImport("ole32.dll", ExactSpelling:=True, PreserveSig:=False)> _
Function CoCreateInstance( _
ByRef clsid As Guid, _
<MarshalAs(UnmanagedType.Interface)> ByVal punkOuter As Object, _
ByVal context As Integer, _
ByRef iid As Guid) _
As <MarshalAs(UnmanagedType.Interface)> Object
End Function
Guid CLSID_ShellDesktop = new Guid("00021400-0000-0000-C000-000000000046");
Type shellDesktopType = Type.GetTypeFromCLSID(CLSID_ShellDesktop, true);
object shellDesktop = Activator.CreateInstance(shellDesktopType);
The CoCreateInstance API
3/20/2013 7:24:55 PM - Matt Smith (Autodesk)-8.19.13.71
Indicates the execution contexts in which an object is to be run
2/15/2012 3:54:10 AM - -115.70.126.167
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).