Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Nov 12, 2019 12:39 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Pointer instead of array problem using quartz.dll
PostPosted: Sat Jun 04, 2011 12:50 pm 
Offline

Joined: Fri Oct 07, 2005 11:03 pm
Posts: 35
i am porting a VB app that handles directshow filters and I'm hung up on creating the list of filters form the regfiltercollection

quartz.dll is added to the project as an activex reference

i have the following to get the pointer to the filter collection which works in both VB and RB

dim m_objRegFilterInfo as Object
m_objRegFilterInfo=QuartzTypeLib.FilgraphManager.RegFilterCollection

In RB, QuartzTypeLib.FilgraphManager.RegFilterCollection is a computed property with the following in the GET statement:

If mThis = Nil Then Raise New NilObjectException
Dim ppUnk_Param As Ptr
Dim func As New RegFilterCollection_Get_Func1( mThis.Ptr( 0 ).Ptr( 56 ) )
Dim resultCode As Integer = func.Invoke( mThis, ppUnk_Param )
If 0 = resultCode Then
If Nil <> ppUnk_Param Then
Return New COM.IDispatch( ppUnk_Param )
End If
Else
Raise New COM.COMException("Failed on RegFilterCollection", resultCode )
End If

in VB m_objRegFilterInfo shows as IAMCollection which is the list I want and the following statement works

'enumerate through each filter in the registered filters collection..
For Each objRegFilter In m_objRegFilterInfo
'append the filtername to the listbox
listRegFilters.AddItem objRegFilter.Name
Next

in RB m_objRegFilterInfo shows as a COM.IDispatch and returns mThis as pointer value

the following statement doesn't work in RB. it expects m_objRegFilterInfo to be an array but it's just a pointer.

'enumerate through each filter in the registered filters collection..
For Each objRegFilter In m_objRegFilterInfo
'append the filtername to the listbox
listRegFilters.AddRow objRegFilter.Name
Next

how do i use the pointer to get the list of filters?

thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: Pointer instead of array problem using quartz.dll
PostPosted: Sun Jun 05, 2011 7:18 am 
Offline

Joined: Sun Mar 26, 2006 11:02 am
Posts: 85
MemoryBlock is pretty smart at converting stuff. You could try something like:
Dim mb As MemoryBlock

mb = m_objRegFilterInfo
... and then look at mb in the debugger to see if it grabbed the data. It's not an array yet but it's a start.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group