Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2005

Tip: Looking for answers? Try searching our database.

conversion from 2003 to 2005 : revisited

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Oliphant - 16 Nov 2005 17:56 GMT
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==]


Tom Serface - 16 Nov 2005 18:23 GMT
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

> 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,
[quoted text clipped - 25 lines]
>
> [==P==]

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.