Src/Pscx.Core/Interop/RunningObjectTable/RunningObjectTableHelper.cs
/// <summary>
/// Converts a COM class ID into a prog id.
/// </summary>
/// <param name="progID">The prog id to convert to a class id.</param>
/// <returns>Returns the matching class id or the prog id if it wasn't found.</returns>
Converts a COM class ID into a prog id.
Converts a COM class ID into a prog id .
public static string ConvertProgIdToClassId(string progID)
        {
            Guid testGuid;
            try
            {
                 NativeMethods.CLSIDFromProgIDEx(progID, out testGuid);
            }
            catch
            {
                try
                {
                    NativeMethods.CLSIDFromProgID(progID, out testGuid);
                }
                catch
                {
                    return progID;
                }
            }
            return testGuid.ToString().ToUpper();
        }
public static string ConvertProgIdToClassId ( string progID ) { Guid testGuid ; try { NativeMethods . CLSIDFromProgIDEx ( progID , out testGuid ) ; } catch { try { NativeMethods . CLSIDFromProgID ( progID , out testGuid ) ; } catch { return progID ; } } return testGuid . ToString ( ) . ToUpper ( ) ; }
Converts a COM class ID into a prog id.
Converts a COM class ID into a prog id .
Returns the matching class id or the prog id if it wasn't found.
Returns the matching class id or the prog id if it wasn ' t found .
progID
string
The prog id to convert to a class id.
The prog id to convert to a class id .