Solved

use 16 bit nddeapi.dll in Win95.

Posted on 1997-10-29
5
240 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
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

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

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
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…

911 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

25 Experts available now in Live!

Get 1:1 Help Now