Solved

BC4.5 to C++ Builder Migrate ?

Posted on 1998-07-30
3
269 Views
Last Modified: 2008-03-06
I have a 16-bit app on Win3.1 compiled in BC4.5 and I need
to upgrade the app to 32-bit to run under Win95. What is
the best path to take ? Should I move to BC5.x or C++ Builder 3 and will the migration just be a re-compile or will I need to do some code changes to the C++ code ???

Thanks in advance,
peet.
0
Comment
Question by:peet
  • 3
3 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1169028
BC5 or Builder will both do.  I prefer builder because it is closer to the C++ standard.  But both will be closer than 4.5 was so it won'e be a problem for you.  

continues.
0
 
LVL 22

Accepted Solution

by:
nietod earned 0 total points
ID: 1169029
>> will the migration just be a re-compile or will I need to do some code changes to the C++ code

that depends.  most things will not need to be changed.  Some Widows API procedures have had their calling format changed to handle the wider sizes.  For example the procedure MoveTo() used to move a GDI pen used to return a 32 bit value that contained the coordinates of the pen.  Now it takes a 64 bit value to specify the coordinates and there is no provision for returning 64 bit values (in C++ you can, but windows has to work with other languages as well).  So instead they removed MoveTo() and added MoveToEx().  This function takes an extra parameter that is a pointer to the point to receive the pen coordinates.

0
 
LVL 22

Expert Comment

by:nietod
ID: 1169030
another area where things have changed is that some windows messages packed 2 16 bit values into the 32 bit LPARAM.  If those values have expanded to 32 bits ( LPARAM is still 32 bits, not 64) there is no room for this.  In these cases the messages have new ways to pass their parameters.   You will need to make adjustments to these.

By and large, you will find that you have to make a bunch of small changes in sections of your program that deal with windows.  These will not be difficult changes that require substancial redesign.  They are just small changes that deal with accessing data, you can then usig the data just as before.

Now if you "broke the rules" and got away with it in win16, you will find that you do have to make large changes.  If you directly accessed hardware or memory you can't under win32.  If you manipulated segment selectors you can't under win32.  If you used DOS calls you can't under win32.

There are several books on the market that specifically deal with porting to Win32.  (in fact the name of one is --Porting to Win32).  If this is a descently large or complex project, you may want to invest in one of these books.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now