Article View: comp.lang.pascal.delphi.misc
Article #302Re: Memory leak receiving events from COM object
From: DonutMan
Date: Wed, 05 Feb 2003 19:50
Date: Wed, 05 Feb 2003 19:50
29 lines
2281 bytes
2281 bytes
David Reeve <drscientific@powerup.com.au> wrote: > > I've just been doing something similar, but using the events wizard > built into D5. A quick check with MemProof shows the clients aren't > leaking when they handle an event. > > I'm no COMS guru either..... this stuff is fun, but really boggles my > tiny brain. However, the Invoke method for the event dispatch looks like > it might be at odds for the way Delphi handles things. Have a look at > TServerEventDispatch.Invoke in the ole.pas. Notice that parameters are > transferred as variant array of type olevariant. Perhaps your > FControl.InvokeEvent in fact does this? What parameter is the > eventhandler code in the client looking for? > > Dave Hi Dave, Thanks for your response. That was very perceptive of you to notice the difference in implementation between my InvokeEvent() method and the corresponding method in TServerEventDispatch. I modified my routine to conform to TServerEventDispatch, and everything still worked, but unfortunately the memory leak was still present. I guess it looks like my only recourse is to rewrite the VB OCX functionality as a Delphi class (or control) and hope the leak doesn't reappear. :( But thanks again for your insight! - Mike
Technical Details
Message-ID:
<12993ff3.0302051150.12320614@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailReferences:
<12993ff3.0302011350.16c4caea@posting.google.com> <3E3C9B7D.E30F7154@powerup.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fd196,cd6ed6b86109629 X-Google-Attributes: gidfd196,public X-Google-Thread: 10baee,cd6ed6b86109629 X-Google-Attributes: gid10baee,public X-Google-ArrivalTime: 2003-02-05 11:50:50 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: sussmans3@cox.net (DonutMan) Newsgroups: comp.lang.pascal.delphi.misc,borland.public.delphi.oleautomation Subject: Re: Memory leak receiving events from COM object Date: 5 Feb 2003 11:50:50 -0800 Organization: http://groups.google.com/ Lines: 29 Message-ID: <12993ff3.0302051150.12320614@posting.google.com> References: <12993ff3.0302011350.16c4caea@posting.google.com> <3E3C9B7D.E30F7154@powerup.com.au> NNTP-Posting-Host: 68.104.169.90 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1044474650 2870 127.0.0.1 (5 Feb 2003 19:50:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 5 Feb 2003 19:50:50 GMT