[program-l] Re: VB6: How can I use a VC++6 DLL Installed in the Same Folder as the VB Application?

  • From: gerald.g.weichbrodt@xxxxxx
  • To: program-l@xxxxxxxxxxxxx
  • Date: Wed, 14 Sep 2005 13:45:05 -0400

Thanks Mark.  I think I remember seeing some of this stuff in the
discussion of side-by-side DLLs in discussions about the Windows Installer
and other such.  Must not have sunk in well.  Thanks again.

Jerry


                                                                                
                                                         
                      "Mark Long"                                               
                                                         
                      <Mark.Long@microsof        To:       
<program-l@xxxxxxxxxxxxx>                                                     
                      t.com>                     cc:                            
                                                         
                      Sent by:                   Subject:  [program-l] Re: VB6: 
How can I use a VC++6 DLL Installed in the Same Folder   
                      program-l-bounce@fr         as the VB Application?        
                                                         
                      eelists.org                                               
                                                         
                                                                                
                                                         
                                                                                
                                                         
                      09/14/2005 01:23 PM                                       
                                                         
                      Please respond to                                         
                                                         
                      program-l                                                 
                                                         
                                                                                
                                                         
                                                                                
                                                         




This will only work with a compiled app but if you put the DLL in the
VB6 directory and then create a VB6.EXE.LOCAL then it will consistently
pick up the version in that directory.

-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx
[mailto:program-l-bounce@xxxxxxxxxxxxx] On Behalf Of
gerald.g.weichbrodt@xxxxxx
Sent: 14 September 2005 18:06
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: VB6: How can I use a VC++6 DLL Installed in the
Same Folder as the VB Application?

Thanks Mark.  Should this work if you're running an app in the VB
environment? or only when it's been compiled and you run the .EXE file?
As
well, am I correct that the file just has to exist in the application
directory but needn't contain anything?

Thanks a lot,
Jerry




                      "Mark Long"

                      <Mark.Long@microsof        To:
<program-l@xxxxxxxxxxxxx>

                      t.com>                     cc:

                      Sent by:                   Subject:  [program-l]
Re: VB6: How can I use a VC++6 DLL Installed in the Same Folder
                      program-l-bounce@fr         as the VB Application?

                      eelists.org





                      09/14/2005 12:02 PM

                      Please respond to

                      program-l









Windows will search the current directory and then the path. However,
you can override this. Assume that your app is called MyApp. Create a
file called MyApp.Exe.Local. This will cause Windows to load all DLLs
and OCX files from the same directory as the application regardless of
current directory or path.

-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx
[mailto:program-l-bounce@xxxxxxxxxxxxx] On Behalf Of
gerald.g.weichbrodt@xxxxxx
Sent: 14 September 2005 16:00
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] VB6: How can I use a VC++6 DLL Installed in the
Same Folder as the VB Application?


The subject doesn't really do my question justice, so here's what I'm
really asking.

Let's suppose I write a VB program and package it, say, with either the
Visual Studio Installer or the Package and Deployment Wizard.  In this
case, I'd just about certainly using Visual Studio Installer, just in
case
anybody wonders.  The important points are these:  I want the user to be
able to change the default install location for the program in case they
want to do so.  Further, I'd like to have the installer drop a little C
DLL
into the program directory to do some low-level manipulation in memory
that's a little hard to do directly in VB.  To give access to the
functions
in the C DLL, I'd stick a "Declare" statement for each function at the
top
of my VB form.  This Declare statement needs to give a location for the
DLL
holding each function.  For instance, one of my Declares might be
something
like:

Private Declare Function UInt82Hex Lib "Type2Hex" Alias "uint82hex"
(ByVal
InVal As Byte, ByVal OutVal As String) As String

My concern is about that clause 'Lib "Type2Hex"'.  If I give a complete
path to the DLL, then I run into trouble if the user decides to put the
application (and with it the DLL) into a different folder somewhere.  If
I
don't give any path information, then it becomes uncertain, I think,
whether the DLL will be found at any given time based on what the
computer
considers to be the current directory.  So is there any way I can make
sure
the application's path will be used when my program tries to access the
DLL?

Thanks,
Jerry

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq



** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq



** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: