How to automate adding DLL references in a vb6 exe project?

Viewed 73

I have a vb6 exe project that calls a vb6 DLL. Both of them are written by me. Every time I compile the vb6 DLL after doing some changes. I have to open the exe project, re-select the compiled DLL, before I can run/compile the exe. How can I automate above process ? I have tried to edit the vbp file, replace the corresponding DLL row with the GUID of the compiled DLL but not success (may be I got a wrong GUID). Actually, I have more than 10 DLLs in the exe project and some DLL even refer another DLL....so any script or method I can automate the process? Thanks.

1 Answers

Use project compatibility instead of binary compatibility. You don't necessarily need binary compatibility if no one else is using your DLL.

From msdn

When Should I Use Version Compatibility?

...

Project Compatibility: Each time you compile the component the type library identifier is kept, so that your test projects can maintain their references to the component project. All class IDs from the previous version are maintained; interface IDs are changed only for classes that are no longer binary-compatible with their earlier counterparts.

(Not sure what the original MSDN page was, but I found this copy of it here.)

If you actually want to inspect the compiled DLL to see what all these IDs are that the article refers to, run OLEView and bind to typelib of your DLL. It will "decompile" the typelib of the DLL where you can see these details. If you recompile it and then diff the typelib text you'll see just how it changed.

Related