473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

gcroot and weak references

Hi,

I see that GCHandle can encapsulate a weak reference, but gcroot appears to
only allow 'normal' GCHandles. Is this correct or is there something I've
missed?

Ta,

Steve
Nov 17 '05 #1
2 2712
Steve,
I see that GCHandle can encapsulate a weak reference, but gcroot appears to only allow 'normal' GCHandles. Is this correct or is there something I've
missed?


It's not surprising, given the main use of gcroot. However, it should be
fairly trivial to write an implementation of it that supports other types of
handles (although, in that case, there are a few overloaded operators I'd
avoid...)

--
Tomas Restrepo
to****@mvps.org
Nov 17 '05 #2
> Steve,
I see that GCHandle can encapsulate a weak reference, but gcroot appears to
only allow 'normal' GCHandles. Is this correct or is there something I've missed?


It's not surprising, given the main use of gcroot. However, it should be
fairly trivial to write an implementation of it that supports other types

of handles (although, in that case, there are a few overloaded operators I'd
avoid...)


OK, cheers, think I've worked around it. You're right - supporting other
types wouldn't be that hard - but I've a great talent for writing
hard-to-find pointer bugs.

Cheers,

Steve
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

94
by: Gabriel Zachmann | last post by:
Is it correct to say that strong/weak typing does not make a difference if one does not use any pointers (or adress-taking operator)? More concretely, I am thinking particularly of Python vs C++....
7
by: Derrick | last post by:
I'm loading a boatload of data into a DataSet. The memory usage grows and grows for the app while loading that data. Calling GC.Collect() reduces the consumption slightly. When I minimize the...
0
by: Rob Haynes | last post by:
I have a DLL with vanilla C functions implemented. I'd like these functions to become wrappers for a managed object. So, I was thinking that the first call would save a pointer statically to the...
2
by: Matthew Herrmann | last post by:
Hi, I've heard from groups that listeners to event handlers cause references to be kept alive, if the targets are marked to stay alive. I need to make sure that attaching events to objects will...
2
by: Maxwell | last post by:
Hello, Im using MC++ VS.NET 2003 and am quite confused with with gcroot template and its use. The issue I am confused about is the need to (or not) delete a pointer to a managed object that you...
6
by: =?Utf-8?B?QWw=?= | last post by:
I am storing an array of strings in an unmanaged MFC class using gcroot as follows: gcroot<array<System::String^>^m_pArr; Nothing out of the ordinary there. However, if I try to use "delete...
3
by: John Nagle | last post by:
Are weak refs slower than strong refs? I've been considering making the "parent" links in BeautifulSoup into weak refs, so the trees will release immediately when they're no longer needed. In...
6
by: =?Utf-8?B?RmFiaWFu?= | last post by:
Hello, I have a class hierarchy distributed over 3 native C++ dlls. The base class has a .NET Windows.Form for status output via a gcroot<>. The gcroot is declared private - the sub classes only...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.