Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Thu, 21 Apr 2005 09:30:47 +0200,    group: microsoft.public.win32.programmer.directx.sdk        back       


Objects left active...   
I managed to write a dummy filter with just one input pin. For now there is
no functionality. But, there is one problem. I'm using graphedt.exe as
executable for debug session. I can add my dummy filter to the graph, but
when I shut down graphedt.exe, I'm getting an ASSERT Failed.

Executable: graphedt.exe Pid d48 Tid d60. Module dummyFilter.ax, 2 objects
left active!
At line 317 of C:\DXSDK\Samples\C++\DirectShow\BaseClasses\dllentry.cpp
Continue? (Cancel to debug)

I can see that static method ObjectsActive() returned 2 instead of 0. Should
I override some method through which is filtergraph trying to tell me to
shutdown or maybe something else???

My filter class is derived from CBaseFilter, and the only pin I have is
derived from CBaseInputPin (member variable of my class derived from
CBaseFilter).

Any suggestions or comments are welcome...

-- 
It is practically impossible to teach good programming to students that have
had a prior exposure to BASIC: as potential programmers they are mentally
mutilated beyond hope of regeneration. (Edsger Dijkstra 1930-2002)
date: Thu, 21 Apr 2005 09:30:47 +0200   author:   Tobia Quantrill

Re: Objects left active...   
"Tobia Quantrill"  wrote in message
news:eUZrfQkRFHA.164@TK2MSFTNGP12.phx.gbl...
> I managed to write a dummy filter with just one input pin. For now there
is
> no functionality. But, there is one problem. I'm using graphedt.exe as
> executable for debug session. I can add my dummy filter to the graph, but
> when I shut down graphedt.exe, I'm getting an ASSERT Failed.
>
> Executable: graphedt.exe Pid d48 Tid d60. Module dummyFilter.ax, 2 objects
> left active!
> At line 317 of C:\DXSDK\Samples\C++\DirectShow\BaseClasses\dllentry.cpp
> Continue? (Cancel to debug)
>
> I can see that static method ObjectsActive() returned 2 instead of 0.
Should
> I override some method through which is filtergraph trying to tell me to
> shutdown or maybe something else???
>
> My filter class is derived from CBaseFilter, and the only pin I have is
> derived from CBaseInputPin (member variable of my class derived from
> CBaseFilter).
>
> Any suggestions or comments are welcome...
>

I've found one problem. The bug was in GetPin() method. I was calling
AddRef() on my pin whenever someone called GetPin(). The only problem left
is destruction of my pin. Like I said, my pin class is derived from
CBaseInputPin, it is member variable of my filer (derived from CBaseFilter.
I guess, the question could be:
What to do during creation/destruction of pin?

TIA
date: Thu, 21 Apr 2005 19:47:00 +0200   author:   Tobia Quantrill

Re: Objects left active...   
> "Tobia Quantrill"  wrote in message
> news:eUZrfQkRFHA.164@TK2MSFTNGP12.phx.gbl...
> > I managed to write a dummy filter with just one input pin. For now there
> is
> > no functionality. But, there is one problem. I'm using graphedt.exe as
> > executable for debug session. I can add my dummy filter to the graph,
but
> > when I shut down graphedt.exe, I'm getting an ASSERT Failed.
> >
> > Executable: graphedt.exe Pid d48 Tid d60. Module dummyFilter.ax, 2
objects
> > left active!
> > At line 317 of C:\DXSDK\Samples\C++\DirectShow\BaseClasses\dllentry.cpp
> > Continue? (Cancel to debug)
> >
> > I can see that static method ObjectsActive() returned 2 instead of 0.
> Should
> > I override some method through which is filtergraph trying to tell me to
> > shutdown or maybe something else???
> >
> > My filter class is derived from CBaseFilter, and the only pin I have is
> > derived from CBaseInputPin (member variable of my class derived from
> > CBaseFilter).
> >
> > Any suggestions or comments are welcome...
> >
>
> I've found one problem. The bug was in GetPin() method. I was calling
> AddRef() on my pin whenever someone called GetPin(). The only problem left
> is destruction of my pin. Like I said, my pin class is derived from
> CBaseInputPin, it is member variable of my filer (derived from
CBaseFilter.
> I guess, the question could be:
> What to do during creation/destruction of pin?
>
> TIA
>

Okay, the problem is solved... Although all these classes are inherited from
IUnknown, objects must be destroyed with delete, instead of calling
Release() method... Don't see why MS couldn't be consistent regarding this??
Same goes for not calling AddRef() in GetPin() method...
date: Fri, 22 Apr 2005 10:28:55 +0200   author:   Tobia Quantrill

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us