Click here to Skip to main content
16,008,750 members
Home / Discussions / C#
   

C#

 
GeneralRe: TreeView problem Pin
Stephane Rodriguez.30-Mar-03 7:05
Stephane Rodriguez.30-Mar-03 7:05 
GeneralRe: TreeView problem Pin
Mazdak30-Mar-03 9:02
Mazdak30-Mar-03 9:02 
GeneralSending Keystrokes/Mouse Clicks Pin
CyberKewl29-Mar-03 22:08
CyberKewl29-Mar-03 22:08 
GeneralRe: Sending Keystrokes/Mouse Clicks Pin
Philip Fitzsimons31-Mar-03 3:26
Philip Fitzsimons31-Mar-03 3:26 
GeneralUsing COM Objects from C# Pin
Andrew Peace29-Mar-03 13:11
Andrew Peace29-Mar-03 13:11 
GeneralRe: Using COM Objects from C# Pin
Stephane Rodriguez.30-Mar-03 5:39
Stephane Rodriguez.30-Mar-03 5:39 
GeneralRe: Using COM Objects from C# Pin
Andrew Peace30-Mar-03 8:07
Andrew Peace30-Mar-03 8:07 
Questiondelegates=strong refs? Pin
Roger Alsing29-Mar-03 7:29
Roger Alsing29-Mar-03 7:29 
is this correct regarding delegates (?) :

if you have a usercontrol , and make it listen to the parent containers mousemove events (say it hooks itself to the parent in the "parentchanged" event)

will the mouse event handlers create a strong ref from the parent to the usercontrol?
(i beleve it does)

the problem if so , is if you remove the usercontrol from its parent , and loose all references to it. (the only valid ref still alive is the delegate target in the parents mouse event)

now , will this usercontrol be garbage collected?
(i beleve it doesnt , since ive profiled this with a mem profiler)

is all the above correct?? , and if not , how come are the usercontrol still alive and kicking when profiling ,even if i have called gc.collect() after loosing all refs.


do i really HAVE TO call .Dispose() on my usercontrol before dropping all refs to it?
and if so , is that really good/standard windows forms coding practice?

according to msdn you should NEVER call .dispose() unless the target holds valuable resources such as gdi objects , file pointers etc , and never ever do it if you are simply dealing with managed code..

//Roger

ps.
if you add a Console.Writeline("blah") to the destructor and dispose you can clearly see that they does NOT fire when the usercontrol have attached itself to some parent container events ,
while if you remove the eventhandlers , finalize and dispose fire just fine...
AnswerRe: delegates=strong refs? Pin
Chris Jobson30-Mar-03 5:16
Chris Jobson30-Mar-03 5:16 
GeneralListView to ListView == not so hot Pin
pimponya200029-Mar-03 5:47
pimponya200029-Mar-03 5:47 
GeneralIE-Com Problem Pin
Calamitous28-Mar-03 22:39
Calamitous28-Mar-03 22:39 
GeneralRe: IE-Com Problem Pin
Stephane Rodriguez.28-Mar-03 22:56
Stephane Rodriguez.28-Mar-03 22:56 
Generala problem about a setup project Pin
zamazula28-Mar-03 20:12
zamazula28-Mar-03 20:12 
GeneralDynamincially Adding Controls to a Win Form Pin
siqbal28-Mar-03 12:30
siqbal28-Mar-03 12:30 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
David Stone28-Mar-03 13:36
sitebuilderDavid Stone28-Mar-03 13:36 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
Stephane Rodriguez.28-Mar-03 20:27
Stephane Rodriguez.28-Mar-03 20:27 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
David Stone29-Mar-03 6:23
sitebuilderDavid Stone29-Mar-03 6:23 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
siqbal29-Mar-03 13:41
siqbal29-Mar-03 13:41 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
David Stone29-Mar-03 16:59
sitebuilderDavid Stone29-Mar-03 16:59 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
Stephane Rodriguez.30-Mar-03 5:42
Stephane Rodriguez.30-Mar-03 5:42 
GeneralInt textBox Pin
blink4me28-Mar-03 9:32
blink4me28-Mar-03 9:32 
GeneralRe: Int textBox Pin
Andreas Philipson29-Mar-03 2:51
Andreas Philipson29-Mar-03 2:51 
GeneralRe: Int textBox Pin
blink4me29-Mar-03 4:59
blink4me29-Mar-03 4:59 
GeneralMime parsing algorithm suggestions requested Pin
Member 9628-Mar-03 8:52
Member 9628-Mar-03 8:52 
GeneralRe: Mime parsing algorithm suggestions requested Pin
leppie28-Mar-03 11:53
leppie28-Mar-03 11:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.