473,396 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Calling a 16-bit DLL in Win95

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

Nov 14 '08 #1
12 1726
kid joe wrote:
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
Nov 14 '08 #2
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.
--
Flash Gordon
If spamming me sent it to sm**@spam.causeway.com
If emailing me use my reply-to address
See the comp.lang.c Wiki hosted by me at http://clc-wiki.net/
Nov 14 '08 #3
kid joe wrote:
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!
Thanks!

Joe

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Nov 14 '08 #4

"jacob navia" <ja***@nospam.comwrote in message
news:gf**********@aioe.org...
kid joe wrote:
>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.
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.

--
Bartc

Nov 15 '08 #5
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
On Fri, 14 Nov 2008 23:17:08 +0100, jacob navia wrote:
kid joe wrote:
>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!
>Thanks!

Joe
Nov 15 '08 #6
Hi Lew,

You are too pessimistic!

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

Best

Joe
On Fri, 14 Nov 2008 16:02:41 -0500, Lew Pitcher wrote:
kid joe wrote:
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
Nov 15 '08 #7

"kid joe" <sp******@spamtrap.invalidwrote in message
news:gf**********@aioe.org...
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.

--
Bartc

Nov 15 '08 #8
kid joe <sp******@spamtrap.invalidwrites:
On Fri, 14 Nov 2008 16:02:41 -0500, Lew Pitcher wrote:
>kid joe wrote:
> 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

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Nov 15 '08 #9
kid joe wrote:
Hi Lew,

You are too pessimistic!

I've always got good answers to all my questions here.
How do you know? The experts in Windows programming hang out elsewhere,
which is where you should be asking.

Its perfectly possible the answers you've been given work by accident,
are deprecated and unsupported by the vendor, or involve horrible hacks
that are likely to fail without warning. As a self-confessed novice, can
you really expect to spot the difference?

Nov 15 '08 #10
kid joe wrote:
>
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)

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Nov 15 '08 #11
kid joe wrote:
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=k...5763&x=10&y=14

Then, you have to create all the thunking scripts, etc.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Nov 16 '08 #12
Thanks a lot for the link, Jacob. It looks incredibly complicated but I'll
give it a go!

Best

Joe
On Sun, 16 Nov 2008 01:03:03 +0100, jacob navia wrote:
kid joe wrote:
>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=k...5763&x=10&y=14

Then, you have to create all the thunking scripts, etc.
--
.--------------------.
| |
| Good Afternoon... | .--.--.
| | .; .;|;. ;.
`-------------. ,---' .;_;' `;_;.
\| ; ;' `; ;
\ ;;'.--.___.--.`;;
;-( o )=( o )-;
( `--' | `--' )
\| . . |/
........... . .:::::. . .______
/ . '---` . '\
.' `. .' \
| ____,.- . | `.....' | _______ |
| ,-' \ /|\'' \.-- |
| / \.'\ /,'. \. - |
| /| ` `\ / \ |
| ,/ _ '/ '\ |
,-' ,-. |o '
/ '| | | | \
/ ,/| |o | \ `
| .' | |.' |. \ \
________/ .'____|________________________||__`. `__________
( \ ) / )
'-. '-. ( .-` .-`
'-. .-'--.__. .-.__.--`-. .-`
'-..' \--' : ~`:=,`- `..-`
\ .. \\ |`-'|`-, /
\\\\\\\) | |`-'/.'/
\)\)\\ `-' `-'
`

Nov 16 '08 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: bhennon | last post by:
Hey all, I have a small php script that calls a random image at the following page. http://www.2006ymcanationals.com/random.php IT WORKS IF I go directly to the above link. I am trying to...
3
by: Cindy Liu | last post by:
Hi Everyone, I created C# COM+ component. It has two overloaded methods - the method names are same and their signatures are different, one takes two parameters and another takes four. I coded...
3
by: Webdiyer | last post by:
I want to integrate SecurID two-factor authentication system of the RSASecurity.inc into our asp.net application,but I get into trouble when trying to call the API functions of the ACE Agent,I got...
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
1
by: Paul Ferrill | last post by:
Can anyone help with the code to call the following C routines: /* Memory model that allows to access memory at offsets of lzo_uint. */ #if !defined(__LZO_MMODEL) # if (LZO_UINT_MAX <=...
5
by: joeblast | last post by:
I have a Web service that gets the financial periods and hold a reference to a disconnected dataset built at initialization. Web methods work on the dataset inside the web service. Everything is...
4
by: astri | last post by:
#include "Unit1.h" #include "math.h" #include "fixed_math.hpp" #include "algorithm.h" #define MBIT 0x4000 #define CBIT 16 long constbl; void __fastcall TForm1::Button1Click(TObject...
15
by: J. Peng | last post by:
Hello, I saw this statement in Core Python Programming book, All arguments of function calls are made by reference, meaning that any changes to these parameters within the function affect the...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
9
by: Catherine Moroney | last post by:
I have one script (Match1) that calls a Fortran executable as a sub-process, and I want to write another script (Match4) that spawns off several instances of Match1 in parallel and then waits...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.