Solved

How to call 16bitDLL from 32bitAPP?

Posted on 1997-11-02
1
148 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now