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.

VC.NET 2005 and ^

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maileen - 02 Nov 2005 07:38 GMT
Hi,

I have a RC version of VC.NET 2005 for testing purpose and i would like to
understand the purpose of ^ character.

Now instead to write :

String strTest="";

we need to write :
String^ strTest= "";

why and what are the implications of this changes ?
i did not find any information in help about it except few words and without
any real detail.

Precision : i'm working under Windows.Forms.

thanks a lot,
Maileen
Arnaud Debaene - 02 Nov 2005 08:20 GMT
> Hi,
>
[quoted text clipped - 4 lines]
>
> String strTest="";
You mean instead of String* strTest="" (old C++ Managed syntax).

> we need to write :
> String^ strTest= "";
>
> why and what are the implications of this changes ?
The purpose is to make clearer the difference between pointers (pointing to
native objects) and handles (referencing managed objects). The latter ones
were called "__gc pointers" in managed C++.

> i did not find any information in help about it except few words and
> without any real detail.
You didn't search strong enough ;-)
http://msdn2.microsoft.com/en-us/library/yk97tc08 (&mong many other articles
on the subject).

Arnaud
MVP - VC
Tom Serface - 02 Nov 2005 17:38 GMT
I think this is one of the best extensions they did and it looks like C++ in
a way.  It is also very clear to see the difference between * and ^
pointers.

Tom

> The purpose is to make clearer the difference between pointers (pointing
> to native objects) and handles (referencing managed objects). The latter
> ones were called "__gc pointers" in managed C++.
Nishant Sivakumar - 02 Nov 2005 16:02 GMT
http://www.voidnish.com/articles/ShowArticle.aspx?code=cppcliintro01

Signature

Regards,
Nish [VC++ MVP]

> Hi,
>
[quoted text clipped - 17 lines]
> thanks a lot,
> Maileen
Peter Oliphant - 09 Nov 2005 23:31 GMT
OK, now I'm worried. If I upgrade to 2005 from 2003 does this mean all my
managed pointers (*) must now be changed to handles (^), that all my managed
new's must be changed to gcnew, etc.? Or is it backwards compatible and
these are new addtional features?

[==P==]

> http://www.voidnish.com/articles/ShowArticle.aspx?code=cppcliintro01
>
[quoted text clipped - 20 lines]
>> thanks a lot,
>> Maileen
Jochen Kalmbach [MVP] - 10 Nov 2005 06:55 GMT
Hi Peter!

> OK, now I'm worried. If I upgrade to 2005 from 2003 does this mean all my
> managed pointers (*) must now be changed to handles (^), that all my managed
> new's must be changed to gcnew, etc.? Or is it backwards compatible and
> these are new addtional features?

You can use the  "/clr:oldsyntax" switch to be (mostly) compatible with
VC2003.

Signature

Greetings
  Jochen

   My blog about Win32 and .NET
   http://blog.kalmbachnet.de/


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.