473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

conversion from 2003 to 2005 : revisited

At one point I started a thread about how hard it is to convert 2003 Managed
C++ code to 2005 /clr C++ code, and said it was too hard. Well, now that
I've been doing it for a while, it isn't really that bad. You have to know a
few rules, and then just allow the compiler to tell you what's wrong.

I run the compiler, and then look at first error it reports. Correct, rinse,
lather, repeat. Usually errors can be corrected in one of the following
ways:

(*) change '*' to '^'
(*) change '__gc' to 'ref'
(*) remove __ from directives (e.g., __delegate => delegate)
(*) change new to gcnew

Arrays are the 'hard' one. change things of the form:

myClass my_class_array[] ;
my_class_array = new myClass[count];

to:

array<myClass>^ my_class_array ;
my_class_array = gcnew array<myClass>(count) ;

There are other changes, but these will get you through most conversions...
:)

[==P==]


Nov 17 '05 #1
1 1101
I think most people will kind of grow into the conversion (that's why they
put the switch to allow you to leave it the old way). Still, as you say,
when you really think about it the conversion is not rocket science. Thanks
for posting these steps. I think these may help others see that it's not
such a big leap to take even though initially they got like a gazillion
warning or error messages.

Tom

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
At one point I started a thread about how hard it is to convert 2003
Managed C++ code to 2005 /clr C++ code, and said it was too hard. Well,
now that I've been doing it for a while, it isn't really that bad. You
have to know a few rules, and then just allow the compiler to tell you
what's wrong.

I run the compiler, and then look at first error it reports. Correct,
rinse, lather, repeat. Usually errors can be corrected in one of the
following ways:

(*) change '*' to '^'
(*) change '__gc' to 'ref'
(*) remove __ from directives (e.g., __delegate => delegate)
(*) change new to gcnew

Arrays are the 'hard' one. change things of the form:

myClass my_class_array[] ;
my_class_array = new myClass[count];

to:

array<myClass>^ my_class_array ;
my_class_array = gcnew array<myClass>(count) ;

There are other changes, but these will get you through most
conversions... :)

[==P==]

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Peter Oliphant | last post by:
I've been trying all morning to convert my 2003 project (managed) to 2005 (/clr since I have both managed and unmanaged code). I'm guessing I have tens of thousands of lines of code to change. Did...
9
by: Vince | last post by:
Hi all, I am trying to convert a VB 6 application to VB.NET 2005 using the wizard. It has over 20 forms and I've used Option Explicit everywhere, hence variables are properly declared and used....
0
by: Rich | last post by:
I am converting my enterprise solution from VS 2003 (.NET v1.1.4322) to VS 2005 Professional (.NET v2.0.50727). The entire solution currently uses the following technologies - Windows Server 2003...
2
by: GW | last post by:
After the conversion and fixing some errs VS2005 threw, project ran OK. Opened xxx.vbproj file after the conversion to VS2005 from VS2003. Changed (usng wordpad) ../msbuild/2003 to 2005...
0
by: StanD | last post by:
Since last Dec I have been waiting for the update that will allow me to port my projects to 2005. I have installed the download, the available update to permit me to successfully do this. I have...
5
by: JT | last post by:
Hi, I'm not sure where the problem is, but I think it's related to the .pdb file. I had a class library created in VS 2003 and decided to convert it to a VS 2005 project/solution. It seemed to...
4
by: Coleen | last post by:
Hi All :-) I'm new to this site. I've been trying to convert several .Net 2003 web applications and getting tons of conversion errors. I found this site to help walk me through the...
6
by: Blasting Cap | last post by:
I'm trying to convert a 1.1 app to 2.0, and keep finding one thing after another that either Framework 2.0 or Visual Studio 2005 doesn't like. Now this - In the global.asax, code that has been...
5
by: kelvin.koogan | last post by:
I want to declare an array of constant strings. In unmanaged C++ I'd do this static const char *string = { "One", "Two, "Three" }; However if I do this in .NET and want to pass these to a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.