Solved

BC4.5 to C++ Builder Migrate ?

Posted on 1998-07-30
3
275 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

623 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