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++ / July 2004

Tip: Looking for answers? Try searching our database.

deterministic destruction support for managed types in VC++ 2005 beta 1

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Slawomir Lisznianski - 25 Jul 2004 06:08 GMT
Do ref classes indeed support instantiation on the stack? Similarly, can
native classes be instantiated on gc heap?

When you try to have a ref class instance on the stack, you'll get:

R : cannot use this type here without a top-level '^'.

When you try to instantiate a native class using gcnew using Visual
Studio 2005 Beta 1, you'll get:

error C2726: 'gcnew' may only be used to create an object with managed type.

I was going through the C++/CLI Language Specification Working Draft
1.5, Jun, 2004, and nowhere I could find a clause that would make me
believe that managed types are allowed to go on the stack or native heap.

I've read articles, such as this one
http://www.codeguru.com/Csharp/.NET/net_general/visualstudionetadd-ins/article.p
hp/c7405/


 that makes all sorts of claims regarding support for deterministic
destruction for managed types. Where is it mentioned in the C++/CLI draft?

Regards,
Slawomir Lisznianski [ www.rhapsodia.org ]
Carl Daniel [VC++ MVP] - 25 Jul 2004 06:43 GMT
> Do ref classes indeed support instantiation on the stack? Similarly,
> can
[quoted text clipped - 16 lines]
>
> I've read articles, such as this one

http://www.codeguru.com/Csharp/.NET/net_general/visualstudionetadd-ins/article.p
hp/c7405/


>   that makes all sorts of claims regarding support for deterministic
> destruction for managed types. Where is it mentioned in the C++/CLI
> draft?

VC++ 2005 will support GC types on the stack, but that support is not in
Beta-1.  I don't know about native types on the GC heap.  I believe that's
in the long-term plan (complete unification of the GC/native type system),
but I'm not sure if it's in the 2005 compiler or not.

-cd
Brandon Bray [MSFT] - 26 Jul 2004 01:52 GMT
> VC++ 2005 will support GC types on the stack, but that support is not in
> Beta-1.  I don't know about native types on the GC heap.  I believe that's
> in the long-term plan (complete unification of the GC/native type system),
> but I'm not sure if it's in the 2005 compiler or not.

Unfortunately, creating native classes with gcnew did not make it into the
Visual C++ 2005 release. It's one of the top features for the next major
release of Visual C++.

Signature

Brandon Bray, Visual C++ Compiler         http://blogs.msdn.com/branbray/
This posting is provided AS IS with no warranties, and confers no rights.


Rate this thread:







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.