Link to home
Start Free TrialLog in
Avatar of jodyl
jodyl

asked on

Win3.x can't find my DLL

I have a Delphi 1.0 app that uses dlls that I wrote in MSVC++ v1.52c.

When the application is run under Win95 there are no problems, but under Win3.x I get an error message when it loads that says that the application or one of it's components can't be found.  The only components are the app, the dlls and the help file.

I've tried the declarations for the functions in the dll in the following two ways:

FUNCTION DTMaxCase( Q : PCHAR ) : LONGINT;  FAR; EXTERNAL
'QDT_DLPH.DLL';

FUNCTION DTMaxCase( Q : PCHAR ) : LONGINT;  FAR; EXTERNAL
C:\WINDOWS\QDT_DLPH.DLL';

I've tried it with the dll in the application directory, the windows directory and the windows system directory, with no success.

I've also compiled both the application and the dll under both Win95 and Win3.11.  Both give the same result.

Does anyone have any idea what might be causing this?  Do I have to declare the dll functions using an INDEX in Win3.x?


Thanks for any help offered,
Jody
Avatar of mirek071497
mirek071497

Try load dll manually (load Library etc.) because You don't know which dll was't found. Program's written in Delphi may need some dll other than You'r.
Run a TDUMP on your EXE and DLL's like so:
TDUMP myapp.exe >myapp.dmp

Load the dump into your favourite editor and search for "Module Reference Table".  Go through this section carefully and make sure that every DLL listed is available to the system.  Is your app using the BDE?  You'll have to make sure its installed under Win 3.1


Avatar of jodyl

ASKER

I checked the output from running TDUMP on the exe and my dlls.  There are no other DLLs used except mine and they don't use any other DLLs.  

Also, the Win95 computers that it is running on would be less likely to have any other modules than the Win3.1 machines I've tried to run it on.  The Win3.1 machines have both Delphi and MSVC++ loaded on them.

I'm not using BDE.

Hmm.  How many calls do you make out to the dlls?  If its fiesable, you might want to go through and create stub functions in your app to take over for the dlls JUST AS A TEST.  I'm not suggesting that you re-write your dlls into the app.  This way you can see if in fact it can't find a dll, or if its something else.  If your app runs without the dlls, add them back one by one to see which one is causing the problem.

I was just looking at some declarations in my Delphi code to access a dll and there is no ".dll" extention on them.  That seems too simple but you never know.


ASKER CERTIFIED SOLUTION
Avatar of peter_vc
peter_vc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jodyl

ASKER

Worked like a charm.

Thanks very much.

Jody