Results 1 to 4 of 4

Thread: Questions about ActiveX DLLs.

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,058

    Questions about ActiveX DLLs.

    Obviously the No Compatibility setting means there's no guaranty that the next time it's compiled it will have any similarity to the previous time it was compiled. But then there's Project Compatibility and Binary Compatibility settings. And I'm not really sure what the difference is. Both of these allow you to select a DLL file from a previous time it was compiled, as a reference to what it's supposed to be compatible with the next time it's compiled. I assume project compatibility that the new version of the source code text is compatible with the VB6 project that was used to compile the previous version of the DLL, while I assume that binary compatibility means that the compiled DLL is compatible with any EXE files that have used previous versions of the DLL. If my assumptions here are wrong, can somebody let me know?

    I'm also not quite sure how to use the compatibility settings. After compiling the DLL once, am I supposed to copy the file to another directory (to make sure it doesn't get overwritten) and use it as a reference for any future times I compile the DLL? Or am I supposed to keep it in the same directory and let it get overwritten each time the DLL gets compiled, using each version of the DLL only as a reference for the next version of the DLL? And in any case, for the copy of the DLL I'm using as a reference (not the one I intend to actually use directly), am I supposed to unregister it with "regsvr32 /u" prior to using it as a reference? Or am I supposed to keep it registered as long as I'm using it as a reference?

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    22,836

    Re: Questions about ActiveX DLLs.

    These are tools for managing compatibility breaks, not preventing them. That is 100% on you.

    See the VB6 docs. Part of this is described in Version Compatibility in ActiveX Components, Versioning Issues for Controls, and When Should I Use Version Compatibility? Those should answer at least some of your questions.

    There just isn't any simple rule to apply. Many of the choices involved are situational.

    There was also some additional support material, circa 1999:

    Binary Compatibility Add-in

    This download includes the document 'Revised Binary Compatibility' as well as the Add-in SyncCompt.dll. Binary Compatibility as implemented in Visual Basic 5.0 and Visual Basic 6.0 ensures that new versions of shipping products are fully compatible with older versions. The document explains issues around Binary Compatibility and GUID revision and introduces the DLL. The DLL add-in builds a new compatibility file to stabilize your product (except Standard EXE's which do not have binary compatibility). This tool only works in an Microsoft Windows NT environment.
    Microsoft no longer appears to host the download of SyncCmp6.exe though.

  3. #3
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    689

    Re: Questions about ActiveX DLLs.

    Quote Originally Posted by Ben321 View Post
    I assume project compatibility that the new version of the source code text is compatible with the VB6 project that was used to compile the previous version of the DLL, while I assume that binary compatibility means that the compiled DLL is compatible with any EXE files that have used previous versions of the DLL. If my assumptions here are wrong, can somebody let me know?
    It's nothing to do with source code.
    It's all about the GUIDs/UUIDs embedded into your component, it's Type Library and the internal versions thereof that allow Windows to tie it all together and make it accessible to other Applications.

    The "Compatibility" options create "back-chains" in the Registry linking these identifiers - the "No Compatibility" option throws all the identifiers away and starts from scratch.

    • Since ActiveX Controls are always Early-Bound to specific type Library versions (check out the .VBP file of any project using them), no Compatibility is a really, really bad idea for these.
    • ActiveX Dll's can be less fussy; it depends on how they are used.


    Quote Originally Posted by Ben321 View Post
    I'm also not quite sure how to use the compatibility settings. After compiling the DLL once, am I supposed to copy the file to another directory (to make sure it doesn't get overwritten) and use it as a reference for any future times I compile the DLL?
    That's a really Good Question.

    Within Binary Compatibility, you can't break the interfaces (unless you ignore VB's warning and press the button anyway!)

    With Project Compatibility, if and when VB decides that you need new versions of your interfaces, etc., then it will just go off and create them for you and create all the back-chaining under the covers so that older versions will be silently redirected to use the new versions.
    But what happens if you really need to break things?
    • Older, Early-bound Applications will need the old file, because that's the only/last place that those identifiers exist (registering this old file will create all the Registry entries up to that point).
    • Newer Early-bound Applications will want the new file, with its new identifiers.


    If, as many people do, you just overwrite the same DLL all the time, then that older file is destroyed, along with all the information in it.

    Regards, Phill W.

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    33,488

    Re: Questions about ActiveX DLLs.

    If you look in my signature block, there's a link - Set your VB6 ActiveX Compatibility - on setting up binary compatibility... it may or may not be of some use. IIRR it shows how to set it up, including setting up multiple release folders each time you build the dll to maintain (or break) compatibility.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width