Calling a 16-bit DLL in Win95

K

kid joe

Hi

I am porting an old 32 bit application that uses thunking to call
a 16bit DLL under Win32s. The application uses functionality
provided by a custom 16 bit DLL (there is no 32 bit version).

I'm trying to get the application working on Win95 with very little
success.

While GetProcAddress() can still locate UT(Un)Register, when
I actually call the located pfnUTRegister to register my
UTProc function I get a FALSE return code (i.e. failed).
If I check GetLastError() then I am told that the function
executed correctly!! Although I know that the UTInit was
not even executed.

Anyone know what is going on. Is it that UT is not supported
under Win95 and if so is there another alternative?

Thanks!

Joe
 
L

Lew Pitcher

kid said:
> Hi
>
> I am porting an old 32 bit application that uses thunking to call
> a 16bit DLL under Win32s. The application uses functionality
> provided by a custom 16 bit DLL (there is no 32 bit version). [snip]
> Anyone know what is going on. Is it that UT is not supported
> under Win95 and if so is there another alternative?

Sorry, Kid Joe, but you are going to get a plethora of responses that
will (almost) all tell you that comp.lang.c has nothing to do with the
special extensions to the C language that Microsoft has implemented to
permit programming in the Microsoft Windows environments. comp.lang.c
discusses programming in "Standard" C (K&R, or one of the the ISO C
standards).

You /really/ should ask your question in a newsgroup that takes
programming in MSWindows as it's subject matter. A newsgroup like
omp.os.ms-windows.programmer, or
comp.os.ms-windows.win95, or
comp.os.ms-windows.misc, or
comp.os.ms-windows.apps
might be able to help you better.

HTH
 
F

Flash Gordon

kid joe wrote, On 14/11/08 20:47:
Hi

I am porting an old 32 bit application that uses thunking to call
a 16bit DLL under Win32s. The application uses functionality
provided by a custom 16 bit DLL (there is no 32 bit version).

I'm trying to get the application working on Win95 with very little
success.

This really is incredibly Windows specific and not a language issue at
all (the problems would be there if you were using Assembler and Visual
Basic) so you need to ask in a Windows group.
 
J

jacob navia

kid said:
Hi

I am porting an old 32 bit application that uses thunking to call
a 16bit DLL under Win32s. The application uses functionality
provided by a custom 16 bit DLL (there is no 32 bit version).

This is not very fresh... Win32s was discontinued in 1994
some 14 years ago. The 16 bit DLL is even older.
I'm trying to get the application working on Win95 with very little
success.

This is not very surprising. You are wasting your time.

While GetProcAddress() can still locate UT(Un)Register, when
I actually call the located pfnUTRegister to register my
UTProc function I get a FALSE return code (i.e. failed).

UT is "Universal Thunk", used to call 16 bit code from
windows 32 bit. Problem is, this is no longer supported
by Microsoft and nobody knows if those entry points are
still functional.
If I check GetLastError() then I am told that the function
executed correctly!! Although I know that the UTInit was
not even executed.

Anyone know what is going on. Is it that UT is not supported
under Win95 and if so is there another alternative?

The alternative is to rewrite those applications under win32

Or, install 64 bit Vista, buy VMware, install msdos with
windows 3.1 and communicate between the application and
the 16 bit dll by using the socket layer!
 
B

Bartc

jacob navia said:
This is not very fresh... Win32s was discontinued in 1994
some 14 years ago. The 16 bit DLL is even older.

The OP is trying to get this working under Win95. Win95 is from (I'm
guessing) 1995, only a year or so later. You would expect these things to
still work.

For reasons why it doesn't, possibly ask on a group with win32 in it.
 
K

kid joe

Hi Jacob,

Thanks a lot for the advice. You've confirmed that it's not an easy
task... but I'd really love to be able to use the functionality from the
16bit DLL, it would be a nightmare to reimplement.

Even if Microsoft don't support it any more (their attitude to backwards
compatibility really stinks!), do you know of a 3rd party DLL that would
do thunking? As I understand it, it just needs the addresses to be
translated from 32-bit style to 16-bit style... someone must have done it?

Thanks

Joe
 
K

kid joe

Hi Lew,

You are too pessimistic!

I've always got good answers to all my questions here.

Best

Joe


kid said:
Hi

I am porting an old 32 bit application that uses thunking to call
a 16bit DLL under Win32s. The application uses functionality
provided by a custom 16 bit DLL (there is no 32 bit version). [snip]
Anyone know what is going on. Is it that UT is not supported
under Win95 and if so is there another alternative?

Sorry, Kid Joe, but you are going to get a plethora of responses that
will (almost) all tell you that comp.lang.c has nothing to do with the
special extensions to the C language that Microsoft has implemented to
permit programming in the Microsoft Windows environments. comp.lang.c
discusses programming in "Standard" C (K&R, or one of the the ISO C
standards).

You /really/ should ask your question in a newsgroup that takes
programming in MSWindows as it's subject matter. A newsgroup like
omp.os.ms-windows.programmer, or
comp.os.ms-windows.win95, or
comp.os.ms-windows.misc, or
comp.os.ms-windows.apps
might be able to help you better.

HTH
 
B

Bartc

kid joe said:
Hi Jacob,

Thanks a lot for the advice. You've confirmed that it's not an easy
task... but I'd really love to be able to use the functionality from the
16bit DLL, it would be a nightmare to reimplement.

Even if Microsoft don't support it any more (their attitude to backwards
compatibility really stinks!), do you know of a 3rd party DLL that would
do thunking? As I understand it, it just needs the addresses to be
translated from 32-bit style to 16-bit style... someone must have done it?

Try google on "calling 16-bit dll".

If you want to try some programming yourself, I think 32-bit/16-bit code
work in different processor modes and can be a bit tricky; perhaps ask in
comp.lang.asm.x86.
 
K

Keith Thompson

kid joe said:
kid said:
I am porting an old 32 bit application that uses thunking to call
a 16bit DLL under Win32s. The application uses functionality
provided by a custom 16 bit DLL (there is no 32 bit version). [snip]
Anyone know what is going on. Is it that UT is not supported
under Win95 and if so is there another alternative?

Sorry, Kid Joe, but you are going to get a plethora of responses that
will (almost) all tell you that comp.lang.c has nothing to do with the
special extensions to the C language that Microsoft has implemented to
permit programming in the Microsoft Windows environments. comp.lang.c
discusses programming in "Standard" C (K&R, or one of the the ISO C
standards).

You /really/ should ask your question in a newsgroup that takes
programming in MSWindows as it's subject matter. A newsgroup like
omp.os.ms-windows.programmer, or
comp.os.ms-windows.win95, or
comp.os.ms-windows.misc, or
comp.os.ms-windows.apps
might be able to help you better.

You are too pessimistic!

I've always got good answers to all my questions here.

It's not pessimism, it's simply an attempt to get you the best help
you can get. The newsgroups mentioned above are full of experts on
just the kind of thing you're asking about. comp.lang.c may have a
few people who know this stuff, but this really is not the best place
to get information about Microsoft-specific issues. Someone could
post a seemingly valid answer with subtle flaws, and it's likely that
nobody else here would catch it; in a Windows group, there are enough
other experts that such errors are less likely to escape scrutiny.
(jacob navia, as far as I know, knows his stuff when it comes to
Windows programming, but he doesn't seem to understand what I've just
told you about the best place to discuss it.)

And please don't top-post. See the following:

http://www.caliburn.nl/topposting.html
http://www.cpax.org.uk/prg/writings/topposting.php
 
C

CBFalconer

kid said:
Thanks a lot for the advice. You've confirmed that it's not an easy
task... but I'd really love to be able to use the functionality
from the 16bit DLL, it would be a nightmare to reimplement.

Even if Microsoft don't support it any more (their attitude to
backwards compatibility really stinks!), do you know of a 3rd party
DLL that would do thunking? As I understand it, it just needs the
addresses to be translated from 32-bit style to 16-bit style...
someone must have done it?

This is off-topic on c.l.c. Try a newsgroup that deals with
Microsoft and/or Windows.

Please do not top-post. Your answer belongs after (or intermixed
with) the quoted material to which you reply, after snipping all
irrelevant material. See the following links:

<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/> (taming google)
<http://members.fortunecity.com/nnqweb/> (newusers)
 
J

jacob navia

kid said:
Hi Jacob,

Thanks a lot for the advice. You've confirmed that it's not an easy
task... but I'd really love to be able to use the functionality from the
16bit DLL, it would be a nightmare to reimplement.

Even if Microsoft don't support it any more (their attitude to backwards
compatibility really stinks!), do you know of a 3rd party DLL that would
do thunking? As I understand it, it just needs the addresses to be
translated from 32-bit style to 16-bit style... someone must have done it?


Look, all the thunking requires compiler support. As far as I remember
that old
procedure, you had to compile the thunks using text files that
contained the description of the thunks needed.


You will have to contact the software museum to get them.


You can start here:
http://support.microsoft.com/?scid=kb;en-us;155763&x=10&y=14

Then, you have to create all the thunking scripts, etc.
 
K

kid joe

Thanks a lot for the link, Jacob. It looks incredibly complicated but I'll
give it a go!

Best

Joe


Look, all the thunking requires compiler support. As far as I remember
that old
procedure, you had to compile the thunks using text files that
contained the description of the thunks needed.


You will have to contact the software museum to get them.


You can start here:
http://support.microsoft.com/?scid=kb;en-us;155763&x=10&y=14

Then, you have to create all the thunking scripts, etc.

--
.--------------------.
| |
| Good Afternoon... | .--.--.
| | .; .;|;. ;.
`-------------. ,---' .;_;' `;_;.
\| ; ;' `; ;
\ ;;'.--.___.--.`;;
;-( o )=( o )-;
( `--' | `--' )
\| . . |/
........... . .:::::. . .______
/ . '---` . '\
.' `. .' \
| ____,.- . | `.....' | _______ |
| ,-' \ /|\'' \.-- |
| / \.'\ /,'. \. - |
| /| ` `\ / \ |
| ,/ _ '/ '\ |
,-' ,-. |o '
/ '| | | | \
/ ,/| |o | \ `
| .' | |.' |. \ \
________/ .'____|________________________||__`. `__________
( \ ) / )
'-. '-. ( .-` .-`
'-. .-'--.__. .-.__.--`-. .-`
'-..' \--' : ~`:=,`- `..-`
\ .. \\ |`-'|`-, /
\\\\\\\) | |`-'/.'/
\)\)\\ `-' `-'
`
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,839
Latest member
MartinaBur

Latest Threads

Top