jd6strings Posted July 28, 2004 Posted July 28, 2004 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: Quote
Administrators PlausiblyDamp Posted July 29, 2004 Administrators Posted July 29, 2004 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); Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
jd6strings Posted July 29, 2004 Author Posted July 29, 2004 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! Quote
Recommended Posts