VB ActiveX and CLSID

I have a VB5 ActiveX DLL that uses it's own CLSID internally and supplies this to client applications via one of it's properties.

The problem is that everytime I make the DLL in VB, a new CLSID is generated and registered for the control.  Since I've been manually copying the CLSID into a string in the source for the control, when it's updated the code is wrong.  It's a catch-22 since when I update the code and rebuild, the CLSID is again updated....

An answer to any of the following would be helpful:

1) How can the control get it's own CLSID programatically and return it as a string through one of it's properties?

2) How can I stop VB5 from updating the CLSID when I make the DLL?

3) How can I manually set a CLSID instead of having VB make it's own.
LVL 32
Who is Participating?
halapayaConnect With a Mentor Commented:
first.. compile and get one dll done.. copy it to a seperate directory

and then in the IDE goto

Project menu, Project Properties
choose Component Tab,

in the Version compatibility section, choose Binary Compatibility, and choose that newly created DLL by browsing from below,

now next time you create the dll, it will keep the interface IDs[CLSID] same.. but if u change any function parameters or so.. and if they are different from the previous dll, it'll break the binary compatiblity.. so u have to design ur dll carefully
jhanceAuthor Commented:
I never would have guessed that.  

I'm starting to remember why I hate VB.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.