Solved

How to call 16bitDLL from 32bitAPP?

Posted on 1997-11-02
1
156 Views
Last Modified: 2013-12-03

HellO!

Win95 includes a DLL, called DISPDIB.DLL. I need to call a function in
this DLL, twice: once at the beginning, and once at the end.
Unfortunately, it is not directly possible to call a 16bit function from
32bit code. I have had a 16bit program working that calls the proper
function in the DLL, so I know it works... but I need to write a 32bit
program of course.

I have read about thunking, and it will probably not be as hard because
I do not need to translate any pointers, as I am not passing any. Is
there any way to do this without assembly? It seems to me that
translating pointers and sizes would be a perfectly mechanical process,
and there should be a Thunk() function. Is there one? I think it would
be silly of MS not to have included something along those lines.

ALTERNATIVELY, is it possible to use DDE instead? Instead of
thunking I would like to set up a tiny 16-bit "server" that operates
this DLL, and allows my client (32bit app) to send it messages. Can this
be done through SendMessage? I don't need to pass/translate any
pointers, but I do need to return focus to the client.
Can I pass the client hWnd to the server, and have the server give focus
to the client? If I spawn the server from the client, how do I get its
hWnd in order to send a message to it?

thanks!
dto@iname.com
0
Comment
Question by:davidotoole
1 Comment
 
LVL 7

Accepted Solution

by:
faster earned 100 total points
ID: 1408132
I think the easiest way is to use the WM_COPYDATA message, since the amount your data is quite small.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question