Product Id
-
Can anyone tell me how to get CLSID of my application and product id of my deployment project?
Hi, You can get the CLSID of your program using VB.Net in the following manner: BEGIN CODE ' Use Server 'localhost'. It can be a remote host! Dim theServer As String = "localhost" ' Use programID 'HKEY_CLASSES_ROOT\DirectoryControl.DirectoryList.1'. Dim myProgID As String = "DirectoryControl.DirectoryList.1" ' Make a call to the method to get the Type information of ' the given ProgID. Dim myType1 As Type = Type.GetTypeFromProgID(myProgID, theServer, True) Console.WriteLine(("GUID for ProgramID " + myProgID + " is: " + myType1.GUID.ToString())) END CODE However, if you are using VB 6.0 then you may use the following code snippet: BEGIN CODE In a VB6.0 project I had the following codes to get CLSID string from a ProgID: ' define some API functions and a structure data type for GUID Function CLSIDFromProgID(ByRef szProgID As String) As String ' First, an API Win32CLSIDFromProgID Call Win32CLSIDFromProgID(StrPtr(szProgID), udtCLSID) ' then, convert CLSID structure type to a long pointer to CLSID ' finally use API CopyMemory to get CLSID string End Function Hope this helps :). END CODE
Regards, John Adams ComponentOne LLC
-
Hi, You can get the CLSID of your program using VB.Net in the following manner: BEGIN CODE ' Use Server 'localhost'. It can be a remote host! Dim theServer As String = "localhost" ' Use programID 'HKEY_CLASSES_ROOT\DirectoryControl.DirectoryList.1'. Dim myProgID As String = "DirectoryControl.DirectoryList.1" ' Make a call to the method to get the Type information of ' the given ProgID. Dim myType1 As Type = Type.GetTypeFromProgID(myProgID, theServer, True) Console.WriteLine(("GUID for ProgramID " + myProgID + " is: " + myType1.GUID.ToString())) END CODE However, if you are using VB 6.0 then you may use the following code snippet: BEGIN CODE In a VB6.0 project I had the following codes to get CLSID string from a ProgID: ' define some API functions and a structure data type for GUID Function CLSIDFromProgID(ByRef szProgID As String) As String ' First, an API Win32CLSIDFromProgID Call Win32CLSIDFromProgID(StrPtr(szProgID), udtCLSID) ' then, convert CLSID structure type to a long pointer to CLSID ' finally use API CopyMemory to get CLSID string End Function Hope this helps :). END CODE
Regards, John Adams ComponentOne LLC