Pointer address and memory window problem 
Author Message
 Pointer address and memory window problem

I'm new to the .net environment and I'm using the language C#.  I have some
pointers in my application and when I debug it, I want to look at both the
address and the contents of the pointers in the memory window.  However,
under the Watch window, the Value column shows only the data type of my
pointer when the Visual Studio 6 would should the address (in hex) of the
pointer.  When I drag and drop that pointer to the memory window, nothing
can be displayed.

Does someone know what I did wrong and how to fix this problem?

Thanks a lot.

Yawen



Mon, 28 Mar 2005 16:56:30 GMT  
 Pointer address and memory window problem
Yawen,

    In .NET you don't have access to pointers, only to references.  The
garbage collector can move memory around at will, so even if you had a
location in memory that held an object, there is no guarantee that it will
be there later on.

    Is there a reason that you need direct memory access?

--
               - Nicholas Paldino [.NET/C# MVP]


Quote:
> I'm new to the .net environment and I'm using the language C#.  I have
some
> pointers in my application and when I debug it, I want to look at both the
> address and the contents of the pointers in the memory window.  However,
> under the Watch window, the Value column shows only the data type of my
> pointer when the Visual Studio 6 would should the address (in hex) of the
> pointer.  When I drag and drop that pointer to the memory window, nothing
> can be displayed.

> Does someone know what I did wrong and how to fix this problem?

> Thanks a lot.

> Yawen



Mon, 28 Mar 2005 22:25:24 GMT  
 Pointer address and memory window problem
Hi Nicholas,

Thanks for your reply.

I need to access to poitners because I'm dealing with bitmap data.  I put
the codes in an unsafe block and .NET allows the codes to run.  I want to
look at the memory during the debugging process.  Do you know of any way
that canj solve the problem?

Quote:
----- Original Message -----

Newsgroups: microsoft.public.dotnet.languages.csharp
Sent: Thursday, October 10, 2002 10:25 PM
Subject: Re: Pointer address and memory window problem

> Yawen,

>     In .NET you don't have access to pointers, only to references.  The
> garbage collector can move memory around at will, so even if you had a
> location in memory that held an object, there is no guarantee that it will
> be there later on.

>     Is there a reason that you need direct memory access?

> --
>                - Nicholas Paldino [.NET/C# MVP]



> > I'm new to the .net environment and I'm using the language C#.  I have
> some
> > pointers in my application and when I debug it, I want to look at both
the
> > address and the contents of the pointers in the memory window.  However,
> > under the Watch window, the Value column shows only the data type of my
> > pointer when the Visual Studio 6 would should the address (in hex) of
the
> > pointer.  When I drag and drop that pointer to the memory window,
nothing
> > can be displayed.

> > Does someone know what I did wrong and how to fix this problem?

> > Thanks a lot.

> > Yawen



Tue, 29 Mar 2005 10:08:02 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Obtaining physical memory address from virtual memory address?

2. Pointer to absolute memory address

3. pointer to absolute memory address

4. NEWBIE: Copying a memory address and not a pointer

5. Unable to see pointer addresses in watch window.

6. memory leak: pointer->pointer->pointer->struct

7. memory block containing pointers, aka pointer to pointer i believe

8. memory Leak: pointer->pointer->pointer->struct

9. Return Memory Pointer from Capture Window

10. Problem allocating memory to pointer, please help

11. Pointer Problem (Accessor Function Replaces Memory with Junk)

12. Pointer to object memory problems using new operator.

 

 
Powered by phpBB® Forum Software