Solved

use 16 bit nddeapi.dll in Win95.

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DataAdapter, stored procedures and parameters 2 53
Example of WebAPI 7 35
Please explain "Multi-Tenant Services" 5 108
.NET tools for adding thread safety to a web app? 3 56
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
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…

749 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