Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Does anyone know the C# equivalent to VC++ API CLSIDFromProgID()? I need to retrieve the CLSID of an unmanaged COM object from the registry and I can't seem to figure it out. Sample PInvoke code for the CLSIDFromProgID method would also work...I think.... :cool:
Posted
Not sure if there is a managed equivalent but the following declaration should work

[DllImport("ole32.dll")]
static extern int CLSIDFromProgID([MarshalAs(UnmanagedType.LPWStr)] string
  lpszProgID, out Guid pclsid);

 

That's what I was looking for....Wasn't sure of the Marshal type. Thank you!

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...