CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2001
    Location
    New Jersey
    Posts
    312

    version of a DLL

    I have a program that I have been working on for a number of years. There is constant changes needed. Anyway the dll's that I bought some time ago are now out of date.

    When a client has by program installed on their computer and then installs or already has installed a program with the same DLL's that I used but newer versions my program blows up.

    Is there a way I could use my old DLLs and allow them to coexist with newer dll's????

    The vender wants more $$$ for the upgraded dll's BUT they do nothing more for me, the ones I have work perfectly preform the job correctly and I dont want to shell out more $$$ for something that works....

    Its a pain when there is not alot of money.
    http://www.dewgames.com
    Shareware and Free games!

  2. #2
    Join Date
    Jul 2003
    Location
    Florida
    Posts
    651
    I'm not sure if this would work in your case, but I think you can put some dlls in the same folder as the exe and the exe will look in it's own folder first. If it works, you could put the older versions in the folder of your app and allow the other apps to update the files in the system directory.
    I'd rather be wakeboarding...

  3. #3
    Join Date
    Apr 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    1,792
    Do a search on here for the phrase "zero length file" under my username and the techniques will be explained
    Be nice to Harley riders...

  4. #4
    Join Date
    Jan 2004
    Posts
    65
    Twodogs >>Do a search on here for the phrase "zero length file" under my username and the techniques will be explained

    I found two links:

    http://www.codeguru.com/forum/showth...hreadid=268623
    http://www.codeguru.com/forum/showth...hreadid=214863

    To sum up: If it's a standard, C DLL, just keep a copy in the directory where the caller EXE lives, and Windows will first look there if you don't specifiy an absolute path.

    If it's a COM DLL (.DLL, .OCX), then it's a pain since until W2K/XP, Windows would first look up the interface's CLSID in the Registry to locate the file, effectively forcing you to use whatever version is registered when your program launches.

    Since W2K, you can try a hack called "side-by-side install" and "DLL/COM redirection", which, as I understand it, consists in create a zero-length file in the directory where the EXE lives, with the name of this EXE with ".local" added to it (eg. myprg.exe -> myprg.exe.local). This is a signal to Windows to first look for any COM component in the current directory before looking up in the Registry, Windows' directories, and the PATH variable.

    Unfortunately, not all COM components were written by taking into account the possibility that multiple versions of themselves might be up and running in parallel, so test your app fully to check for errors like conflicts when writing state infos in the Registry, etc.

    Fred.

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

Featured