use 16 bit nddeapi.dll in Win95.

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.
mextexAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tflaiCommented:
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
mextexAuthor Commented:
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
tflaiCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mextexAuthor Commented:
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
tflaiCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.