Solved

BC4.5 to C++ Builder Migrate ?

Posted on 1998-07-30
3
271 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What does std::atomic give me? 7 124
how to understand recursion 12 226
Find Visual Studio Tools 2 103
Safe conversion? 4 67
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

770 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