?
Solved

use 16 bit nddeapi.dll in Win95.

Posted on 1997-10-29
5
Medium Priority
?
259 Views
Last Modified: 2013-12-03
I need to access API provided by nddeapi.dll in Win95.  Since I'm writing a Win32 application, LoadLibrary fails because of the incompatibility with 16 bit DLL. I was told that I can use flat thunk technique to do it. But I just wonder if anyone out there has already done it and provide me information of how to do it. I think that for those NetDDE applications written for Win3.11, someone should have done this already.

I also read the documenatation in MSDN which provides  some info about flat thunk.

What I really want is if someone already does it, I'll  like to get more details.
0
Comment
Question by:mextex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:tflai
ID: 1408041
First, write a 16-bit DLL that uses API provided by nddeapi.dll.  And then write two DLL's that provide interface to your 32-bit application using thunk mechanism.  (3 this way, or you can shrink to 2 if you want to.)  You're right, this particular method is called the flat thunk (32-bit to 16-bit) and is documented in the MSDN.
Things you need to compile flat thunk DLL's:  16-bit compiler, 32-bit compiler, thunk script compiler, assembler compiler, and the Windows Resource Compiler.  Documentation to guide you through writing the script, two sets of makefile, debugging, ......
There is an example in MSDN's SDK under \samples\frmwork\thunks95.  Also, there is one floating around in the web somewhere, I don't remember where it is, but you'll find it searching the web.

0
 

Author Comment

by:mextex
ID: 1408042
Actually, I got all the  tflai's info from the MSDN. What I want is if someone has already done it (say a workable thunk script for nddeapi.dll), I would like to get a copy of the script. I have all the function prototypes for the API but I can't find the documentation about the functions and their corresponding parameters. As a result, it is very difficult to create the thunk script. Anyway, thanks for the input, tflai.
0
 
LVL 4

Accepted Solution

by:
tflai earned 100 total points
ID: 1408043
What you mean?  If you already have "nddeapi.h" & "nddeapi.lib", which MSVC has, that should give you enough information to write a 16-bit DLL based on that.  And then write the thunk script for the functions you've written based on the NDDEAPI functions.  Or if you really want to just write the thunk for NDDEAPI functions directly, you could just put in "inout" for all the pointer parameters (if you're not sure on whether it's an input pointer or an output pointer).

0
 

Author Comment

by:mextex
ID: 1408044
I actually did what exactly tflai  suggested before I read tfai's new comment. However I run into a problem when I tried to generate the 16 bit object file with the .asm file generated by the thunk compiler (I don't have any problem of creating the 32 bit object using the same .asm file). It shows bunch of "error A2004: symbol type conflict" errors. Not being a assembly language programmer, I think I need some time to figure it out what's going on.
0
 
LVL 4

Expert Comment

by:tflai
ID: 1408045
Are you sure your 16 bit makefile looks OKAY, something like the following:

...<skipped>...
DLLMFLAGS   = /c /DIS_16 /W3 /Zi /nologo
...<skipped>...
32to16.asm: ..\32to16.thk
     thunk -t thk -o 32to16.asm ..\32to16.thk
thunk16.obj: 32to16.asm
    ml $(DLLMFLAGS) /Fo thunk16.obj 32to16.asm
...<more>...

Then compiling the assembler file "32to16.asm" shouldn't give you any error messages.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

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