Click to See Complete Forum and Search --> : Help: Using 16-bit DLL from 32-bit application


July 16th, 1999, 06:29 AM
Hello friends,

I am currently involved in a project where I have to use an old 16-bit .DLL, (written in BC++ 4.5 - no sources available) from my Win32 application developed with VC++6.0.
I understand that I can not call the .DLL directly from my application. Searching the MSDN I found that there are two ways to tackle this problem:
- Use thunking
- Use another solution explained in Q141939 (Knowledge Base, Visual Basic for Windows KBase, Miscellaneous Related Information) that involves the use of a 16-bit OLE server that will wrap the 16-bit DLL functions and act as a bridge to
the 32-bit aplication.
The first soloution seems quite complicated to me and requires quite a lot of
work. I currently try the second one ( trying to develop the OLEServer with
BC++4.52) but I have not manage to make it work yet.

Does anybody know of any easier way to use 16-bit DLL from 32-bit application?

Any comments, suggestions and help will be greatly appreciated.

Thanks in advance

KGr

Gary Grant
July 16th, 1999, 08:50 AM
This will involve extra work (maybe a lot of extra work) but if I were you I would reverse engineer the
16-bit dll and create a new 32-bit dll with the same functionality.

The reason I would create a brand new dll (even though it would have to be written from scratch)
is that as technology advances older technology is dropped. Microsoft has announced that future
versions of Windows will NOT support 16-bit code in a 32-bit process space.
You eventually will have to totally replace all your 16-bit code anyways so do it now
before your customers/clients install a new version of Windows (Windows2000?)
that will break your application and force you into a crisis mode.