1

I have an ActiveX control made in the vb6. Since the client is asking to change the class id and I have no knowledge of vb6, Please help me to determine the class id of an ActiveX.

I have searched a lot on the internet. but of no use.

In C++ the Class ID is mentioned in the '.idl' file. But in vb6 I have no idea.

Thanks in advance.

Imran Khan Hunzai
  • 304
  • 1
  • 3
  • 17

1 Answers1

4

After you load the project into VB6, open Project... Properties and look at the Component tab. If the Version Compatibility is set to Binary, VB will attempt to keep the same CLSID (assuming it has a model). If you change this to No Compatibility, or if you change the interface, VB will assign a new CLSID when you compile.

Jim Mack
  • 1,070
  • 1
  • 7
  • 16
  • @Bundle of thanks, It worked. but how to determine new class id in the Windows Registry? – Imran Khan Hunzai Jan 10 '17 at 12:18
  • 1
    @ImranKhanHunzai One way is to register it using Regsvr32 and search the CLSIDs in the registry for the public name. You can unregister it when done if that's an issue. I believe you could also use RegHacker to look at the EXE, but the CLSID would not be in a 'friendly' format. There may be a more straightforward way, but I've never had to do this, so... – Jim Mack Jan 10 '17 at 13:10
  • 2
    You can also use the OLE View tool that ships with VB6 to examine the compiled DLL/OCX's typelib. The format shown is in MIDL syntax. – Bob77 Jan 10 '17 at 13:56
  • 2
    Another way would be to start a new project, include the AX as a reference or component, save the project and open the VBP in a text viewer. The CLSID will be listed there. Note that doing this will have the side-effect of registering the component, if that matters. – Jim Mack Jan 10 '17 at 14:05