Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed with dll file

Status
Not open for further replies.

engrfurqan

Programmer
Jan 5, 2009
20
when we are using declare statment like bellow

Private Declare Function GetTempPath Lib "abc.dll" _
Alias "GetTempPathA" (ByVal nBufferLength As Long,
ByVal lpBuffer As String) As Long

What would be location where vba will look for this dll file? This file is not there in the reference list.
 
DLL files should normally be in the \Windows\System folder, but they can be anywhere.

If you are looking for the Windows TEMP folder then use Environ("TEMP") instead.
 
It is not there in system folder. Actually this file is used in a nwetwork comprising of more than 50 Pcs I have many copies of this file in different locations and I am not sure which file is active one. Is there any method to find out this?

I have two dll files with same name and different versions and I want to use both of them together with the declare statement.
 
Welcome to DLL hell.
You have to register DLLs in Windows before you can use them. You can only register or use one version of the DLL at a time.
 
Can you throw some light on the process of registring dll
 
Have a look at regsvr32

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Is it possible to specify complete file name with location of dll which is not registerd, will it work?
 
>when we are using declare statment like below
>Private Declare Function GetTempPath etc.

We are dealing with a 'normal' dll and not an ActiveX dll and so registering the dll with RegSvr32 is not required; indeed it should fail. Normal dlls are not displayed in the references list.

When a Function is Declared within a dll, as per your code example, I believe the calling program will first look in its application folder for the file and if not found a few other likely but standard places before finally having a look in System32.
 
Windows will search for a DLL in the following order:
1. The current folder, this is the folder from which the app is launched
2. All folders in the PATH in the order in which they are listed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top