Solved

How to call 16bitDLL from 32bitAPP?

Posted on 1997-11-02
1
153 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 Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

12 Experts available now in Live!

Get 1:1 Help Now