Board index » delphi » Calling 16-bit DLLs from 32-bit Apps

Calling 16-bit DLLs from 32-bit Apps

Hi,

Does anyone know of any way at all to call a 16-bit DLL from a 32-bit
application? I know this sounds strange, but I have my reasons - trust me!
For the record, I'm using Delphi 3 and Delphi 1.

In fact, if anyone knows for sure that this isn't possible then I'd
appreciate that too.

Thanks,
Robin.

 

Re:Calling 16-bit DLLs from 32-bit Apps


On Sun, 5 Apr 1998 05:50:31 +0100, "Robin Balmforth" <rob...@enterprise.net>
wrote:

Quote
>Hi,

>Does anyone know of any way at all to call a 16-bit DLL from a 32-bit
>application? I know this sounds strange, but I have my reasons - trust me!
>For the record, I'm using Delphi 3 and Delphi 1.

>In fact, if anyone knows for sure that this isn't possible then I'd
>appreciate that too.

>Thanks,
>Robin.

I don't know about 32-bit programs using 16-bit, but I know you can use 32-bit
DLLs in 16-bit programs. The delphi unit that does it is call32nt.

I believe the zip file is of the same name (call32nt.zip).

Perhaps, you could just write the program in 16-bit and use call32nt to access
32-bit DLLs. If this is't good enough, perhaps you could contact the author of
call32nt. I don't have the DOCs for call32nt handy, so you'll have to download
it and read the "readme" file.

Hope this was of some help.

If you do find a way to use 16-bit DLLs in 32-bit apps, please let me know

                                                        DJ
                                                        (p...@gate.net).

Re:Calling 16-bit DLLs from 32-bit Apps


Hi,

You'll have to make a thunk layer for the 16 bit DLLs you want use from
your 32 bit code. You can find more information from Microsoft site
or from MSDN. I've used it couple of times and it works, but it is not
the easiest things to do. And you have to have different tools than
Delphi to do it (VC++ 16 bit, ASM compiler etc.)...

Hope this helps,

Ville Mikkonen

Quote
Robin Balmforth wrote:
> Hi,

> Does anyone know of any way at all to call a 16-bit DLL from a 32-bit
> application? I know this sounds strange, but I have my reasons - trust me!
> For the record, I'm using Delphi 3 and Delphi 1.

> In fact, if anyone knows for sure that this isn't possible then I'd
> appreciate that too.

> Thanks,
> Robin.

Re:Calling 16-bit DLLs from 32-bit Apps


Quote
Ville Mikkonen wrote in message <35273A41.F7EE1...@mirasys.fi>...
>Hi,

>You'll have to make a thunk layer for the 16 bit DLLs you want use from
>your 32 bit code. You can find more information from Microsoft site
>or from MSDN. I've used it couple of times and it works, but it is not
>the easiest things to do. And you have to have different tools than
>Delphi to do it (VC++ 16 bit, ASM compiler etc.)...

Note however that this will work only on Windows 95, not on NT. Only an
idiot writes programs which won't work under NT!

Chris
----------------------------------------------------------------
Chris Marriott, SkyMap Software, UK (ch...@skymap.com).
Visit our web site at: http://www.skymap.com
Astronomy software written by astronomers, for astronomers.

Re:Calling 16-bit DLLs from 32-bit Apps


Hi.

Quote
>Does anyone know of any way at all to call a 16-bit DLL from a 32-bit
>application? I know this sounds strange, but I have my reasons - trust me!
>For the record, I'm using Delphi 3 and Delphi 1.

Visit the Delphi Super Page and download
"freres.zip" and "zthunk.zip". They are good sample codes.

-------
Hiki Takehito.

Re:Calling 16-bit DLLs from 32-bit Apps


I have heard that thunking is going away in win98.  The reason is for
stability.  Thus the 16<-->32 95 code is history.

Is this true?  Does this mean 16 bit code will not run on 98?  Or is it
just the 16 <-> 32 thunking that won't work.

-John_Mer...@Brown.EDU

Re:Calling 16-bit DLLs from 32-bit Apps


In <6g72is$o3...@news.enterprise.net>, "Robin Balmforth"

Quote
<rob...@enterprise.net> wrote:
>Does anyone know of any way at all to call a 16-bit DLL from a 32-bit
>application? I know this sounds strange, but I have my reasons - trust me!
>For the record, I'm using Delphi 3 and Delphi 1.

If your target is Windows 95 then take a look at Brian Long's very
informative article 'Calling 16-Bit Code From 32-Bit In Windows 95' in
the 'Delphi Magazine' ( Issue 12 -  August 1996 )
The article with updates is currently online at
http://www.itecuk.com/delmag/thunk95.htm

Other Threads