Click to See Complete Forum and Search --> : 16 bit dll's with 32 bit programs
harryn4484
November 7th, 2002, 08:08 PM
I would like to use some 16 bit dll's (originally developed with Borland 3.5) with 32 bit programs running on windows NT. I understand that for win 98 I can use a 'Flat' Thunk but is not available for NT. What is the best way to use these dll's. The code is very complex and extensive and would be a year or so to rewrite.
cup
November 10th, 2002, 12:31 AM
Why not just rebuild the 16-bit DLLs into 32 bit DLLs if you have the source code? You don't have to bother with thunking then. You'd be surprised how little you have to change when 16-bit code is passed through a 32-bit compiler.
Paul McKenzie
November 10th, 2002, 06:29 AM
I agree with cup. Why not just recompile the code with a 32-bit compiler and see how things work out? The thing that you need to watch out for in your code are
a) assuming that int's are 16-bits. In 32-bit programming int's are 32-bits.
b) Some windows messages such as WM_COMMAND process the WPARAM and LPARAM differently between 16 and 32-bit Windows. Most of the time, it is that HWND's are 32-bit values instead of 16-bit values.
c) Assembly language designed for 16-bit OS. This will need a rewrite since 16-bit OS-dependent assembly language cannot be directly ported to 32-bit programming (for example, interrupts, direct I/O control, etc.)
There is no need for a total rewrite of your code if you take care of the items listed above. Except for item c), the only thing that you need is a debugger and patience, fixing the int and message handling problems and correcting them.
Regards,
Paul McKenzie
s. roelants
November 10th, 2002, 06:40 AM
very true,
i once did a porting of a suite of several apps from 16 to 32 bits
didn't have much problems, the problems i mostly had where due to:
bugs that didn't show up in 16 bit but showed up in 32 bit (easily fixable)
exotic controls used from third party 16 bit dll's, for which i made the equivalents using standard 32bit controls (Tree, List and such)
i think i had just 1 problem where wraparound was assumed because int used to be 16 bit
so it's not hard at all
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.