Solved

BC4.5 to C++ Builder Migrate ?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

943 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

18 Experts available now in Live!

Get 1:1 Help Now