Results 1 to 6 of 6

Thread: [RESOLVED] Early bind/referencing ActiveX DLL problem

  1. #1

    Thread Starter
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Resolved [RESOLVED] Early bind/referencing ActiveX DLL problem

    I have few ActiveX DLLs and one EXE, all stored in some folder. Then i have a BAT file, where i:

    - copy all DLLs and EXE to the folder where BAT is located (optional) and
    - run EXE.

    Here's the problem. EXE is referencing old DLLs (located in the "original" folder). Is there a way, i can assing new (copied) DLLs as a reference to my new (copied) EXE? Here's why... i can't recompile any DLL if any instance of EXE is still running cause it's referencing it/em'.

    Thank you!

    -gav

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Early bind/referencing ActiveX DLL problem

    You would have to unregister them and reregister them with the new path for it to use the new location.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Early bind/referencing ActiveX DLL problem

    Also, you don't have to use early binding at all - it's only convenient during development.
    Before deploying I usually "switch" to late bindings (CreateObject...) - this way your app doesn't necessary depend on most recent release of your dll but it must be fully backward compatible.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Early bind/referencing ActiveX DLL problem

    Quote Originally Posted by RhinoBull
    Also, you don't have to use early binding at all - it's only convenient during development.
    Before deploying I usually "switch" to late bindings (CreateObject...) - this way your app doesn't necessary depend on most recent release of your dll but it must be fully backward compatible.
    And with late binding, you should be able to register your DLL in form load and unregister it on unload if desired. In the code bank there is a project for doing this. I think the only issue is that if the DLL was created with binary compatibility, then maybe registration might fail if older version is in use? Dunno, never tried it. However, late binding prevents WithEvent declarations and Implements I would think.
    Last edited by LaVolpe; Jan 10th, 2008 at 09:54 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Early bind/referencing ActiveX DLL problem

    Quote Originally Posted by LaVolpe
    ...However, late binding prevents WithEvents declarations and Implements I would think.
    Most often this shouldn't even be an issue - I personally almost never use it anyway...

  6. #6

    Thread Starter
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Early bind/referencing ActiveX DLL problem

    Quote Originally Posted by RobDog888
    You would have to unregister them and reregister them with the new path for it to use the new location.
    Of course
    Quote Originally Posted by RhinoBull
    Also, you don't have to use early binding at all - it's only convenient during development.
    Before deploying I usually "switch" to late bindings (CreateObject...) - this way your app doesn't necessary depend on most recent release of your dll but it must be fully backward compatible.
    I'll concider this

    Thanks again!

    -gav

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