Solved

use 16 bit nddeapi.dll in Win95.

Posted on 1997-10-29
5
238 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
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:tflai
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 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

11 Experts available now in Live!

Get 1:1 Help Now