CLSIDFromProgID() equivalent in C#?

jd6strings

New member
Joined
Jul 28, 2004
Messages
3
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 cant seem to figure it out. Sample PInvoke code for the CLSIDFromProgID method would also work...I think.... :cool:
 
Not sure if there is a managed equivalent but the following declaration should work
C#:
[DllImport("ole32.dll")]
 static extern int CLSIDFromProgID([MarshalAs(UnmanagedType.LPWStr)] string
   lpszProgID, out Guid pclsid);
 
PlausiblyDamp said:
Not sure if there is a managed equivalent but the following declaration should work
C#:
[DllImport("ole32.dll")]
 static extern int CLSIDFromProgID([MarshalAs(UnmanagedType.LPWStr)] string
   lpszProgID, out Guid pclsid);

Thats what I was looking for....Wasnt sure of the Marshal type. Thank you!
 
Back
Top