Board index » delphi » call 16 Bit DLL from 32 Bit Delphi Application

call 16 Bit DLL from 32 Bit Delphi Application

Is possible to call 16 Bit DLL from 32 Delphi (or not Delphi)
Application?

Can anyone help me?

  thanks

 

Re:call 16 Bit DLL from 32 Bit Delphi Application


Quote
pippo wrote:

> Is possible to call 16 Bit DLL from 32 Delphi (or not Delphi)
> Application?

16-bit DLL's can only be called by 16-bit applications, Delphi or other.
32-bit DLL's can only be called by 32-bit applications, Delphi or other.

Idar Tollefsen

Re:call 16 Bit DLL from 32 Bit Delphi Application


Quote
Idar Tollefsen wrote:

> pippo wrote:

> > Is possible to call 16 Bit DLL from 32 Delphi (or not Delphi)
> > Application?

> 16-bit DLL's can only be called by 16-bit applications, Delphi or other.
> 32-bit DLL's can only be called by 32-bit applications, Delphi or other.

This is, AFIK, not true.  A process called 'thunking' can be used to
call a 16 bit dll from a 32 bit dll.  See the article by Brian Long at
http://www.itecuk.com/delmag/thunk95.htm for a discussion of the issue.

It is also the case that a 16 bit program can control a 32 bit program
via OLE automation, which is just a case of a 16 bit program calling a
32 bit DLL, therefore this is also somehow possible (although I only
know how to do it ).

--
Oliver
oli...@zip.com.au
Ph: +61-2-9283-1377 (w) 9675-1769 (h) 0411 754 414 (mob)
Permission is given to reproduce this article in whole or in part
provided its meaning is not changed, and it is acknowledged.

Re:call 16 Bit DLL from 32 Bit Delphi Application


Quote
Oliver Townshend wrote:
> This is, AFIK, not true.  A process called 'thunking' can be used to
> call a 16 bit dll from a 32 bit dll.  See the article by Brian Long at
> http://www.itecuk.com/delmag/thunk95.htm for a discussion of the issue.

Yes, of course, you are correct. I actually think I read somethink similar a
year back when I had the same problem myself. What it boiled down to was that it
wasn't worth it. Better to port the 16-bit DLL to 32-bit.

Idar Tollefsen

Re:call 16 Bit DLL from 32 Bit Delphi Application


In article <3649F285.15B84...@zip.com.au>, Oliver Townshend
<oli...@zip.com.au> writes
Quote
>Idar Tollefsen wrote:

>> pippo wrote:

>> > Is possible to call 16 Bit DLL from 32 Delphi (or not Delphi)
>> > Application?

>> 16-bit DLL's can only be called by 16-bit applications, Delphi or other.
>> 32-bit DLL's can only be called by 32-bit applications, Delphi or other.

>This is, AFIK, not true.  A process called 'thunking' can be used to
>call a 16 bit dll from a 32 bit dll.  See the article by Brian Long at
>http://www.itecuk.com/delmag/thunk95.htm for a discussion of the issue.

>It is also the case that a 16 bit program can control a 32 bit program
>via OLE automation, which is just a case of a 16 bit program calling a
>32 bit DLL, therefore this is also somehow possible (although I only
>know how to do it ).

You can also use a process called "generic thunking" to call 32-bit DLL
functions from 16-bit apps. Go to the Delphi Super Page (http://www.suns
ite.icm.edu.pl/delphi) and take a look at CALL32NT.ZIP, written by
Christian Ghisler. I have used it to successfully call 32-bit DLL
functions from my D1 apps under Win 95 & NT.

Hope the above helps.
--
Steve Turner
Leeds, England

Other Threads