Quote:
> Hi everybody,
> Is it possible, without a lot of hustle, to make a 16-bit application
> 32-bit? With Delphi maybe? I curently have an application that was
> implemented in BP 7.0 with a lot of dialogs (a lot of RES files that is to
> say, which I dont want to redesign), running in Windows 3.1 and NT, and
even
> have some parts in assembly... Tough problem, e?
First the bad news - you can't port your program to 32-bits just by
recompiling; the assembly code, the resource files etc. have different
formats under Win32.
Now the "good" news.
1. IIRC, the Resource Workshop allows you to read in the resources from an
existing project and write it out as a .RC text file. This file can then be
converted to a .RES file by the 32-bit Resource Workshop.
2. Any 16-bit-dependent code will require rewriting. Specifically, code that
manipulates the segment and/or offset of pointers will require modification.
3. All inline assembly code will require rewriting to use 32-bit registers;
any pointer manipulations require careful rethinking.
4. Pay special attention to the sizes of structures written to disk. Don't
forget that Integer is now 4 bytes, rather than 2 bytes.
5. Some 16-bit Windows APIs are obsolete in Win32. Pay especial attention to
uses of the Escape() API. Procedures that use MoveTo(), LineTo() and other
APIs that returned the new position as a DWORD should be rewritten to use
MoveToEx(), LineToEx() etc.
I would follow the following procedure:
1. Divide the units of your 16-bit program into units that contain no
assembly-language, pointer arithmetic etc. and units that do contain such
problems.
2. Remove the obsolete Windows APIs from your 16-bit program (most of the
new forms are available even in Windows 3.1).
3. Examine the problematic units, checking whether the pointer manipulation
is really neccesary. If it was merely a speed/size optimisation - replace it
with a portable method of performing the same function.
4. Test your 16-bit program thoroughly before continuing.
5. (32-bit conversion) Convert all the inline assembly to 32-bit assembly,
and deal with any remaining pointer manipulations.
6. Recompile the resources as I suggested above and link with your 32-bit
program.
7. Test your new 32-bit program thoroughly. Don't forget to ensure that it
can read files created by the 16-bit program, if neccesary.
Good luck!
Daniel Pfeffer