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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLL file not found 1

Status
Not open for further replies.

gswetzel

Technical User
Mar 7, 2002
11
US
In my VB6 project I am referencing a dll which produces a 'file not found' error on a Windows 2000 machine. The same program runs fine on Win 95 & 98. I tried putting the dll in different folders, using the fully qualified path in the declaration, but still get the error. The error occurs when invoking a dll function.

I saw this same problem in the Delphi forum, with no solution posted, only suggestions which I've tried and don't work.

No help on Microsoft that I can find.

 
I have a small C++ dependency-checker that you can run from the command line against your EXEs, DLLs and OCXs that will show the dependencies, "where located", and version information. It will also identify missing components. Please contact me by email if you are interested.
 
Chris, you have come to the same conclusion I have: somehow PCOMM can find the DLL and subs, but the VB app can't. There is nothing in the path variable for this DLL(on either machine), and it and all subDLL'd, except the Win2Ks are located in the default PCOMM folder.

I did as an experiment, try to register the DLL, and it will only register if I put a copy in the system32 folder with all other PCOMM sub DLL's(adding PCOMM default to path is no help), and in this case VB will find the DLL function. However, it won't connect to the PCOMM session, I think because the PCOMM session is using the DLL's in the default PCOMM folder. Go figure.

Greg
 
Ok Greg,

No more Mr. Nice Guy.

If it works placing it in the System32 folder, Try putting your VB app in the default PCOMM folder and running it from there.

Chris Dukes
 
Thanks Chris, I tried putting the VB app in the system32 folder, but that doesn't work.

This is what works, which I thought would never work: Before calling any DLL function, use the Chdir "path to the pcshll32.dll" statement. Everything works OK after that.

VB can be strange. Thanks everyone for your replies. I thought you deserve to know my fix.

Greg

 
Greg,

It works because as mentioned earlier windows will look for DLL's in the following directories:

System32 Directory
Current Running Directory
Any direcory in the PATH variable

by using Chdir "path to the pcshll32.dll" you are in fact changing your current running directory and hence it finds the DLL.

You should also find that if you put a copy of the program in the "path to the pcshll32.dll" and run it from there it should also work.

Glad you have got it going,

Chris Dukes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top