Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

BC4.5 to C++ Builder Migrate ?

Posted on 1998-07-30
3
Medium Priority
?
277 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

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

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…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

885 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