Board index » delphi » Delphi and DLL's

Delphi and DLL's

Hello,

One question, who knows the answer?

A Delphi 1.x  program uses a DLL (also Delphi 1.x). this program uses the
next declaration

CONST
    DLLNAME = 'KBDLG.DLL';
.......
    Function KB_bar(Var bar:integer):boolean ; external DLLNAME

This works fine on my PC (Windows 95). BUT on an other PC (Windows 3.11)
and on a PC wit Windows NT 3.5 The program can not find the DLL.

BUT if the declaration reads like:

    Function KB_bar(Var bar:integer):boolean ; external 'KBDLG.DLL'

It works on all tree PC's.  WHY is this??  I want to use a CONST because
there are more Function in the DLL and maybe the name of the DLL changes.

Thanks

      Fons Reijsbergen         EMail Fons.Reijsber...@konbib.nl
                                         or 100451.2...@compuserve.com
       http://ourworld.compuserve.com/homepages/F_Reijsbergen

       Leidschendam   Netherlands
            Tel  +31  70 3140499
            Tel  +31  6 54 768438

 

Re:Delphi and DLL's


Quote
"Fons Reijsbergen" wrote:
>A Delphi 1.x  program uses a DLL (also Delphi 1.x). this program uses the
>next declaration
>CONST
>    DLLNAME = 'KBDLG.DLL';
>.......
>    Function KB_bar(Var bar:integer):boolean ; external DLLNAME
>This works fine on my PC (Windows 95). BUT on an other PC (Windows 3.11)
>and on a PC wit Windows NT 3.5 The program can not find the DLL.
>BUT if the declaration reads like:
>    Function KB_bar(Var bar:integer):boolean ; external 'KBDLG.DLL'
>It works on all tree PC's.  WHY is this??  I want to use a CONST because
>there are more Function in the DLL and maybe the name of the DLL changes.

I just tried this.  Wrote a dummy DLL and an EXE to call a function in
it, using Delphi 1 on Win 3.10 and it ran fine.  Then tried the same
DLL & EXE (ie not re-compiled) on Win 3.11 and Win 95 and it was still
OK.  Seems your problem is elsewhere.

Regards,
--
Duncan
LECS Ltd

Re:Delphi and DLL's


Quote
Fons Reijsbergen wrote:

> Hello,

> One question, who knows the answer?

> A Delphi 1.x  program uses a DLL (also Delphi 1.x). this program uses the
> next declaration

> CONST
>     DLLNAME = 'KBDLG.DLL';
> .......
>     Function KB_bar(Var bar:integer):boolean ; external DLLNAME

> This works fine on my PC (Windows 95). BUT on an other PC (Windows 3.11)
> and on a PC wit Windows NT 3.5 The program can not find the DLL.

> BUT if the declaration reads like:

>     Function KB_bar(Var bar:integer):boolean ; external 'KBDLG.DLL'

> It works on all tree PC's.  WHY is this??  I want to use a CONST because
> there are more Function in the DLL and maybe the name of the DLL changes.

> Thanks

Are you absolutely sure that this is the exact declaration? I do know
that including/excluding the .DLL extension confuses either 95 or NT
(not sure which).

It probably doesnt matter, but you should append a ; to the end of the
declaration lines. Please let us know how this works out, this was, at
least to me, a new behaviour of Delphi....

--
Need a custom component? Late on a project? Could use an util?
DOS Device driver? A VxD? NT drivers or services? Applications of any
kind?
Low rates, fast delivery!

When responding to news postings, please CC a copy to my email address.
Thanks.
Erik Sperling Johansen <e...@info-pro.no>

Re:Delphi and DLL's


<encoded_portion_removed>
ICBUZWwgICszMSAgNiA1NCA3Njg0MzgNCiANCiA=

Other Threads