Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Windows NT and DLL problem

Posted on 1998-12-22
6
Medium Priority
?
200 Views
Last Modified: 2010-04-04
   I wrote a DLL in Delphi3 and compiled it under NT
when I run my main program that uses the DLL, it gives me the messsage that "DLL not found c:\winnt;c:\winnt\system;c:\winnt\system32" But in at least one of them DLL exist.
What can be the reason ?
thanks in advance...
0
Comment
Question by:guvencum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 3

Accepted Solution

by:
williams2 earned 200 total points
ID: 1352547
That's because you unfortunately have specified a wrong directory for your dll.

Lets say you generate a Project1.dll in the same directory as your main project, let's call it project2.

When loading a dll it should be done like this:

  procedure LoadAndShowDll(Filename: String);
  var
    DllHandle: THandle;
    Init: procedure;
  begin
    DllHandle := LoadLibrary(pChar(Filename));
    if DllHandle <> 0 then
    Begin
      @Init    := GetProcAddress(DllHandle, 'Init');
      Init;
    End;
  End;

Regards,
Williams
0
 
LVL 3

Expert Comment

by:williams2
ID: 1352548
..so I forgot:

LoadAndShowDll('C:\Project2.dll'); //Project2 is in the Root of C:\

:-)

Cheers,
Williams
0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1352549
If you're declaring a function like this:

function DoYouFeelLuckyPunk: Boolean; stdcall; external 'MYFILE';

then change 'MYFILE' to 'MYFILE.DLL'. Back in the old D1 days, I noticed that you had to supply the extension or the dll was not found. This was only on NT, and was D1. Maybe this is a problem on D3 too?

(BTW: The D3 sources supply the extension)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 12

Expert Comment

by:rwilson032697
ID: 1352550
Philip: Actually, you could get away without the extension in D1, but in D2 you suddenly needed to include it (something to do with Win32...)

Cheers,

Raymond.

0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1352551
OK D2 then, it was just a vague memory. But thank you for the correction. Maybe I'll return the favour the next time there is a unicode question eh? Cheers.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1352552
Ouch - that hurts :-)

Cheers,  Raymond.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question