@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The CoCreateInstanceEx API !!!!C# Signature: [DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)] static extern void CoCreateInstanceEx( [In, MarshalAs(UnmanagedType.LPStruct)] Guid rclsid, [MarshalAs(UnmanagedType.IUnknown)] object pUnkOuter, CLSCTX dwClsCtx, IntPtr pServerInfo, uint cmq, [In, Out] MULTI_QI[] pResults); !!!!User-Defined Types: [CLSCTX], [MULTI_QI] !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: Please add some! !!!!Alternative Managed API: Have a look at System.Activator.CreateInstance@msdn and its various overloads. Sample: Guid CLSID_ShellDesktop = new Guid("00021400-0000-0000-C000-000000000046"); Type shellDesktopType = Type.GetTypeFromCLSID(CLSID_ShellDesktop, true); object shellDesktop = Activator.CreateInstance(shellDesktopType); If you just want to create an instance on a specific server, you can pass the server name into GetTypeFromCLSID: Guid CLSID_ShellDesktop = new Guid("00021400-0000-0000-C000-000000000046"); Type shellDesktopType = Type.GetTypeFromCLSID(CLSID_ShellDesktop, "REMOTESERVER", true); object shellDesktop = Activator.CreateInstance(shellDesktopType); Documentation: CoCreateInstanceEx@msdn on MSDN
Edit ole32.CoCreateIns...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.