Results 1 to 15 of 15

Thread: Use One DLL in preference to Another? (* !RESOLVED! *)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732

    Use One DLL in preference to Another? (* !RESOLVED! *)

    Hi All,

    Does anybody know of a way in VB to use one DLL in preference to another?

    I.E. There is a version of MyExample.DLL on the PC, registered etc and sitting in "C:\WINNT\System32".

    Now I Install my application and put another version of the MyExample.DLL in the same dirtectory as the EXE, but I don't register it...

    Is there anyway to get my EXE to use the "local" version of the DLL, rather than the one in "C:\WINNT\System32"?

    I know this is possible in other languages, just not sure about vb?
    Last edited by Leather; Nov 26th, 2002 at 07:02 AM.
    Leather Face is comin...


    MCSD

  2. #2
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    I believe it's possible with VB.NET and the MS .NET Framework, but with VB 6, I don't think it's possible, except if you application unregisters one DLL, and then registers the one you want to use...
    Although don't quote me on that...

    Woka

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    Its ok, ive found the solution.. and its really simple!

    Just hard to find on MSDN..


    If anyone else is interested let me know..
    Leather Face is comin...


    MCSD

  4. #4
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Just hard to find on MSDN..
    So post the link while it's in your history file or we'll all have to go thrpugh this process if we want to know the answer...
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    Sorry, but its from my local MSDN installation..

    If you want to know the answer I can just tell you, its that simple...
    Leather Face is comin...


    MCSD

  6. #6
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Originally posted by Leather
    Its ok, ive found the solution.. and its really simple!

    Just hard to find on MSDN..


    If anyone else is interested let me know..
    Oy southern shandy drinking, can I have an cocktail umbrella in my pint, essex bloke, why don't you just post the link anyways...?

    Hehehehe

    Woka

  7. #7
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Originally posted by Leather
    Sorry, but its from my local MSDN installation..

    If you want to know the answer I can just tell you, its that simple...
    Bad Leather...*SLAP*



    Woka

  8. #8
    Addicted Member nihar's Avatar
    Join Date
    Jan 2002
    Location
    somewhere between home and office
    Posts
    234
    Post it please.
    serve the purpose of the forum dude.
    ciao,
    Nihar

    VB 6 Enterprise SP5;
    SQL Server 2000

  9. #9
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577
    Originally posted by Leather
    Sorry, but its from my local MSDN installation..

    If you want to know the answer I can just tell you, its that simple...

    Well while its just that simple, you should tell everyone anyway.

    So..

    I would like to know how its done, could you please post how its done, thank you

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    Oi less of it Wokawidget you northern car theif, wheres your KAPPA tracksuit?


    How do you know I have cocktail umbrellas in my drinks! hehe

    Ok, the solution is...

    Install your exe and all of its dlls into the same DIR. DO NOT REGISTER THE DLL's.

    Create an empty file in the same directory with the same name as your exe, including the extension, and add ".Local" to the end of its name.. e.g. "MyApp.Exe.Local"

    Now windows 2000 will check for a .local file when starting an EXE, if one is found it uses local DLL's in preference to registered ones.
    Leather Face is comin...


    MCSD

  11. #11
    Addicted Member nihar's Avatar
    Join Date
    Jan 2002
    Location
    somewhere between home and office
    Posts
    234
    Aaargh.... and i thought he had a solution for wint9x/NT.
    ciao,
    Nihar

    VB 6 Enterprise SP5;
    SQL Server 2000

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    Sorry nihar, it may work on those platforms, its just this is the only one mentioned in the article, and the one I'm currently using...

    Of course if this is part of COM+ then it will only work on 2000 and XP..
    Leather Face is comin...


    MCSD

  13. #13
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Originally posted by nihar
    Aaargh.... and i thought he had a solution for wint9x/NT.
    Yea...What about NT?! Grrrrrrrrrrrrrrrrr.

    Leather...I do not own a kappa tracksuit, nor have a stole any cars! I had a boring childhood. Hit a pheasant on my way to work this morning though...it's now in the boot of my car ready to be eaten in 3 days...*YUM*

    Woka

  14. #14
    Addicted Member nihar's Avatar
    Join Date
    Jan 2002
    Location
    somewhere between home and office
    Posts
    234
    Originally posted by Leather
    Sorry nihar, it may work on those platforms, its just this is the only one mentioned in the article, and the one I'm currently using...

    Of course if this is part of COM+ then it will only work on 2000 and XP..
    Its ok dude. i shud have guessed it. i expected a miracle

    Originally posted by Wokawidget

    Yea...What about NT?! Grrrrrrrrrrrrrrrrr.

    yes what abt it? dis method wont work on NT as well.


    PS- the extra content in this thread is way 2 sensible stuff.
    ciao,
    Nihar

    VB 6 Enterprise SP5;
    SQL Server 2000

  15. #15
    Let me in .. techyspecy's Avatar
    Join Date
    Aug 2002
    Location
    Back to VBF.
    Posts
    2,456
    Originally posted by Leather
    Oi less of it Wokawidget you northern car theif, wheres your KAPPA tracksuit?


    How do you know I have cocktail umbrellas in my drinks! hehe

    Ok, the solution is...

    Install your exe and all of its dlls into the same DIR. DO NOT REGISTER THE DLL's.

    Create an empty file in the same directory with the same name as your exe, including the extension, and add ".Local" to the end of its name.. e.g. "MyApp.Exe.Local"

    Now windows 2000 will check for a .local file when starting an EXE, if one is found it uses local DLL's in preference to registered ones.
    Thats pretty cool. Thanks

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