Board index » cppbuilder » linking 32 bit modules with 16 bit modules

linking 32 bit modules with 16 bit modules


2003-11-22 05:42:10 AM
cppbuilder69
I need to call functions in a DLL from a Java program, but that DLL is
compiled in 16 bit mode and I don't have the source code. I need to call
functions from a Java program by means of JNI.
I think I have to write a DLL to be compiled in 32 bit mode in order to make
it callable from JNI and from this DLL call the DLL which has the function I
actually need.
I'm using Borland Compiler 5.5
Any hint?
Thanks a lot in advance
 
 

Re:linking 32 bit modules with 16 bit modules

Jose:
You must use thunks, but it's not possible in W2k, only in Win9x (to call a
16 bit DLL from a 32bit one).
It's possible to do with BC5.0x but dont know about 5.5. You should check a
the cppbuilder.commandlinetools newsgroup,
that's the official site for the BCC5.5.
Saludos
Sebastian
"Jos?Miguel" < XXXX@XXXXX.COM >escribi?en el mensaje
Quote
I need to call functions in a DLL from a Java program, but that DLL is
compiled in 16 bit mode and I don't have the source code. I need to call
functions from a Java program by means of JNI.
I think I have to write a DLL to be compiled in 32 bit mode in order to
make
it callable from JNI and from this DLL call the DLL which has the function
I
actually need.
I'm using Borland Compiler 5.5

Any hint?

Thanks a lot in advance


 

Re:linking 32 bit modules with 16 bit modules

I need to call functions in a DLL from a Java program, but that DLL is
compiled in 16 bit mode and I don't have the source code. I need to call
functions from a Java program by means of JNI.
I think I have to write a DLL to be compiled in 32 bit mode in order to make
it callable from JNI and from this DLL call the DLL which has the function I
actually need.
I'm using Borland Compiler 5.5 and my system is Windows XP
Any hint?
Thanks a lot in advance
 

{smallsort}

Re:linking 32 bit modules with 16 bit modules

On Sat, 22 Nov 2003 00:47:42 +0100, "Jos?Miguel"
< XXXX@XXXXX.COM >wrote:
Quote
I need to call functions in a DLL from a Java program, but that DLL is
compiled in 16 bit mode and I don't have the source code. I need to call
functions from a Java program by means of JNI.
I think I have to write a DLL to be compiled in 32 bit mode in order to make
it callable from JNI and from this DLL call the DLL which has the function I
actually need.
I'm using Borland Compiler 5.5 and my system is Windows XP
32-bit code cannot directly call 16-bit code on Windows XP/2k/NT (a
32-bit process cannot call a function in a 16-bit DLL). One
possibility would be to write a 16-bit EXE that loads the the 16-bit
DLL and calls the functions in it. You can then write a 32-bit DLL to
be loaded via JNI that launches the 16-bit EXE and communicates with
it via a IPC mechanism that works between 16-bit and 32-bit EXEs
(Windows messages, DDE, COM, files, etc).
Java EXE<->JNI<->32-bit DLL<->IPC<->16-bit EXE<->16-bit DLL
Or you could try to find or code a replacement for the 16-bit DLL.
Chris Hill
XXXX@XXXXX.COM
 

Re:linking 32 bit modules with 16 bit modules

Thanks for your help.
"Chris Hill" < XXXX@XXXXX.COM >escribi?en el mensaje
Quote
On Sat, 22 Nov 2003 00:47:42 +0100, "Jos?Miguel"
< XXXX@XXXXX.COM >wrote:

>I need to call functions in a DLL from a Java program, but that DLL is
>compiled in 16 bit mode and I don't have the source code. I need to call
>functions from a Java program by means of JNI.
>I think I have to write a DLL to be compiled in 32 bit mode in order to
make
>it callable from JNI and from this DLL call the DLL which has the
function I
>actually need.
>I'm using Borland Compiler 5.5 and my system is Windows XP

32-bit code cannot directly call 16-bit code on Windows XP/2k/NT (a
32-bit process cannot call a function in a 16-bit DLL). One
possibility would be to write a 16-bit EXE that loads the the 16-bit
DLL and calls the functions in it. You can then write a 32-bit DLL to
be loaded via JNI that launches the 16-bit EXE and communicates with
it via a IPC mechanism that works between 16-bit and 32-bit EXEs
(Windows messages, DDE, COM, files, etc).

Java EXE<->JNI<->32-bit DLL<->IPC<->16-bit EXE<->16-bit DLL

Or you could try to find or code a replacement for the 16-bit DLL.

Chris Hill
XXXX@XXXXX.COM