Solved

32-bit application call 16-bit dll on Windows NT

Posted on 1997-11-06
3
324 Views
Last Modified: 2013-12-03
Is it possible for a 32 bit application call a third-party 16-bit dll, using Generic Thunk's WOWCallback16....? I can hardly find any example on it either from MSDN or Web.

If it's not possible, are there any other alternatives? The data exchange between applicaiton and DLL are of huge amount.

I would appreciate any hints or details!
0
Comment
Question by:DonLi
3 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1408246
Generic Thunks allow a 16-bit Windows-based application to load and call a Win32-based DLL on Windows NT and Windows 95. A Win32-based application can load and call a 16-bit DLL on Windows 95 using a thunk compiler.
0
 
LVL 1

Expert Comment

by:Tiutin
ID: 1408247
Windows 95 implements a thunking model called flat thunks. Flat thunks allow 32-bit code to call functions implemented in 16-bit code. They also allow 16-bit code to call functions implemented in 32-bit code. Windows NT does not support flat thunks. Therefore, if you use flat thunks, your application cannot run on Windows NT unless you isolate your thunking code into platform-specific DLLs.

Windows NT uses a different thunking model. Windows NT supports generic thunks, which allow 16-bit code to call functions implemented in 32-bit code. Although Windows 95 supports generic thunks, it does not support the underlying process model used by Windows NT. This means that generic thunking code might not work identically under Windows 95 and Windows NT.

So, there seems to be no answer.
0
 
LVL 3

Accepted Solution

by:
vinniew earned 100 total points
ID: 1408248
You can't load a 16-bit process into a 32-bit process, so no matter what, data has to cross a process boundary.  That's going to cause extra overhead, always.

You could try to write a 16-bit app that uses a global piece of memory to communicate with a 32-bit app.  That's the fastest way that I've seen/used.  Write the 16-bit app to use the .dll and then set global flags when its time to pass data back and forth.

Just don't use pointers (or convert them yourself) and you should be ok.

V

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

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…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

13 Experts available now in Live!

Get 1:1 Help Now