Board index » delphi » *** DLL ***: What am I doing wrong???

*** DLL ***: What am I doing wrong???

What I did:

  declaration:

   function func(param: type, ...): Type; stdcall; external 'name.dll';

  usage:

   result := func(,,..);

  Error received:  "De{*word*81} kernel error. Error Code: 1"

Any suggestions will be greatly appriciated!

P.S. Accessing The specified dll in Delphi1.0 is just fine ( where
     stdcall is replaced with far and '.dll' extension omitted), but
     fails in Delphi2.0

P.S. 2. I also tried dynamic linking using LoadLibrary: Delphi1.0
        return a handle value greater than 32; Delphi2.0 0.

          In addition, for 'project1.dll' - which is supplied in
        delphi2.0 - delphi1.0 and delphi2.0 returns different handles.  

Regards,
Gang.

{wilcom Pty Ltd, Australia}

 

Re:*** DLL ***: What am I doing wrong???


Quote
Swee Yeo wrote:

> What I did:

>   declaration:

>    function func(param: type, ...): Type; stdcall; external 'name.dll';

>   usage:

>    result := func(,,..);

>   Error received:  "De{*word*81} kernel error. Error Code: 1"

> Any suggestions will be greatly appriciated!

> P.S. Accessing The specified dll in Delphi1.0 is just fine ( where
>      stdcall is replaced with far and '.dll' extension omitted), but
>      fails in Delphi2.0

> P.S. 2. I also tried dynamic linking using LoadLibrary: Delphi1.0
>         return a handle value greater than 32; Delphi2.0 0.

>           In addition, for 'project1.dll' - which is supplied in
>         delphi2.0 - delphi1.0 and delphi2.0 returns different handles.

I'll assume the DLL has been recompiled for 32-bit (if it hasn't -- that's
your problem). Try running the program outside the integrated de{*word*81}, and
you'll probably get a more descriptive error message.  The most common
problem in this case is that the function names aren't matching up.  Run
TDUMP with the -m switch on the DLL to see the names of the exported
functions.  When you find the name of the function you're tyring to call,
use this syntax for the declaration:

function Fun(Param: Type,...): Type; stdcall exteranl 'name.dll' name 'Fun';
--

        -Steve Teixeira
         steix...@borland.com

Re:*** DLL ***: What am I doing wrong???


In article <00009414+00005...@msn.com., Swee...@msn.com (Swee Yeo) says:
.
.What I did:
.
.  declaration:
.  
.   function func(param: type, ...): Type; stdcall; external 'name.dll';
.
.
.  usage:
.
.   result := func(,,..);
.
.
.  Error received:  "De{*word*81} kernel error. Error Code: 1"
.
.
.Any suggestions will be greatly appriciated!
.
.
.
.P.S. Accessing The specified dll in Delphi1.0 is just fine ( where
.     stdcall is replaced with far and '.dll' extension omitted), but
.     fails in Delphi2.0
.
.P.S. 2. I also tried dynamic linking using LoadLibrary: Delphi1.0
.        return a handle value greater than 32; Delphi2.0 0.
.
.          In addition, for 'project1.dll' - which is supplied in
.        delphi2.0 - delphi1.0 and delphi2.0 returns different handles.  
.
.
.
.Regards,
.Gang.
.
.{wilcom Pty Ltd, Australia}

Check my post under 'bug in calling convenction in Delphi 2.0 ?'.
If you can't find it just email me.

Pedro

Re:*** DLL ***: What am I doing wrong???


Quote
> .   function func(param: type, ...): Type; stdcall; external 'name.dll';

There is a dodgy bug in win3.x and delphi combination, don't put '.dll' at the end
of the name just use 'name'

Win95 doesn't seem to mind.

This appears to be true only on win3.x and delphi V1

John B

Re:*** DLL ***: What am I doing wrong???


 ...we came in?
/------------------------------------------------------------------------\

 JB> There is a dodgy bug in win3.x and delphi combination, don't put '.dll'
 JB> at the end of the name just use 'name'

 JB> Win95 doesn't seem to mind.

neither does NT, it seems. in fact in all the Delphi2 RT files, it is  
written as name.dll

cu
marc
/--------------------------------------------------------------------------\
|m...@donut.de    marc hoffman@2:2444/1234    m...@arb-phys.uni-dortmund.de|
\--------------------------------------------------------------------------/
                                                       isn't this where...
## CrossPoint v3.1 ##

Other Threads