[DllImport("ole32.dll")]
static extern int OleRegGetUserType([In] ref Guid clsid, uint dwFormOfType,
[Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszUserType);
None.
The above C# signature didn't work for me. Instead, I used:
[DllImport("ole32.dll")]
static extern int OleRegGetUserType([In] ref Guid clsid, uint dwFormOfType, out IntPtr pszBuff);
and then marhalled the Unicode string pointer to a managed string. See the sample code below.
Please add some!
Guid clsid = new Guid(0x3e6b91f5, 0xbc86, 0x40b8, 0x80, 0xc9, 0x41, 0xb3, 0x4b, 0x4e, 0x8f, 0x11);
IntPtr pszBuf;
int nResult = OleRegGetUserType(ref clsid, (uint)USERCLASSTYPE.USERCLASSTYPE_FULL, out pszBuf);
string strClass = Marshal.PtrToStringUni(pszBuf);
Do you know one? Please contribute it!