Re: Microsoft Document Explorer - VC++ 2005
- From: John Gabriel <JohnGabriel@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 6 May 2005 11:40:03 -0700
Hmmm. Let me see:
> I think this is because it is Beta and the documentation is redesigned. Current
> Help in 2003 is OK.
Where does this leave me with VC++ 2005 - do you acknowledge this is a
problem which is going to be fixed, i.e. Microsoft knows about it?
Well Ioannis, you may be correct but I am going by the documentation I read:
Start Quote:
Declares a handle to an object on the managed heap.
A handle to an object on the managed heap points to the "whole" object, and
not to a member of the object.
See gcnew for information on how to create an object on the managed heap.
In Visual C++ 2002 and Visual C++ 2003, __gc * was used to declare an object
on the managed heap. The ^ replaces __gc * in the new syntax.
Remarks
The common language runtime maintains a separate heap on which it implements
a precise, asynchronous, compacting garbage collection scheme. To work
correctly, it must track all storage locations that can point into this heap
at runtime. ^ provides a handle through which the garbage collector can track
a reference to an object on the managed heap, thereby being able to update it
whenever that object is moved. Member selection through a handle (^) uses the
pointer-to-member operator (->).
End Quote.
Seems to me that when one uses ^, the compiler generates code so that it is
used as an index into an array of pointers to objects on the *managed heap*
the CLR uses to manage the separate heap.
So in this sense it is not a pointer and can not be used as one. So although
you state that *Handles have different semantics than usual pointers* - this
is only true for the CLR for in all previous versions of C++, it was
essentially the same as a pointer. Strange then that it is called a *handle*
and not a *gc-index*.
> In .NET, C++ is two worlds. The unmanaged world and the managed world. In
> the managed world every .NET feature is provided separately from the
> unmanaged world features.
So I am led to believe. Your webpage makes sense. Can I take it for granted
everything you state is correct or do I need to make yet more comparisons
against other sources? :-)
.
- Follow-Ups:
- Re: Microsoft Document Explorer - VC++ 2005
- From: Ioannis Vranos
- Re: Microsoft Document Explorer - VC++ 2005
- From: Jochen Kalmbach [MVP]
- Re: Microsoft Document Explorer - VC++ 2005
- References:
- Microsoft Document Explorer - VC++ 2005
- From: John Gabriel
- Re: Microsoft Document Explorer - VC++ 2005
- From: Ioannis Vranos
- Microsoft Document Explorer - VC++ 2005
- Prev by Date: Re: BYTE* to BSTR
- Next by Date: Using UpdateResource() to add a resource
- Previous by thread: Re: Microsoft Document Explorer - VC++ 2005
- Next by thread: Re: Microsoft Document Explorer - VC++ 2005
- Index(es):
Relevant Pages
|