I'll make this the 2nd option then.
Thanks,
Announcement
Collapse
No announcement yet.
Get iEnumerator from nodelist
Collapse
X
-
Could this mean i don't need the Invoke(-4) stuff for any late bound Dispatch interface?
Leave a comment:
-
-
The classic way is to add the _NewEnum method/property to your collection class and, in that method, return a pointer to your implementation of the IEnumVARIANT class. Calling QueryInterface for IEnumVARIANT won't work if the enumerator isn't implemented in the same class.
Leave a comment:
-
-
is it possible to implement this enumerator interface into PB classes?
Maybe simply adding it icw it's guid?
I don't have much influence on the QueryInterface is it?
Leave a comment:
-
-
Oh btw, i used call dword with vtable offsets, forgot to memtion.
I just rewrote it.
Leave a comment:
-
-
That is a compiler issue and solvable.
For me it's more important i can use this on any interface (unknown/dispatch) which supports the enumeration.
And -4 is a 'fixed' member also and i could use this but i like this better.
I also believe this will help me with non-dual interfaces.
Leave a comment:
-
-
For some reason, the built-in QueryInterface method does not work if you pass a constant. Use a variable as I did in my previous post:
Code:Local pUnk As Dword Ptr Local IID_IEnumVARIANT As GUID IID_IEnumVARIANT = $IID_IEnumVARIANT If oDisp.QueryInterface(IID_IEnumVARIANT, ByVal VarPtr(pUnk)) = 0 Then End If
Leave a comment:
-
-
This works:
Code:If oDisp.Invoke( -4, IID_NULL, 0, 1 Or 2, udispparams, vResult, ByVal VarPtr( pExcepInfo ), puArgErr ) = 0 Then oEnum = vResult: vResult = Empty End If
Code:Local pUnk As Dword Ptr If oDisp.QueryInterface($IID_IEnumVARIANT, ByVal VarPtr(pUnk)) = 0 Then End If
Leave a comment:
-
-
Oops, though that wasn't possible.
When i took a closer look i was thinking you did this on the resulting interface.
Could this mean i don't need the Invoke(-4) stuff for any late bound Dispatch interface?
Leave a comment:
-
-
Use:
Code:LOCAL hr AS LONG LOCAL pEnum AS IEnumVARIANT LOCAL IID_IEnumVARIANT AS GUID IID_IEnumVARIANT = $IID_IEnumVARIANT hr = oNodeList.QueryInterface(IID_IEnumVARIANT, BYVAL VARPTR(pEnum))
Leave a comment:
-
-
I just found out that i misinterpret someone's code.
This subject can be deleted, it's going nowhere.
Leave a comment:
-
-
Maybe pEnum needs to be defined as a PTR variable type?
As written, the compiler would pass a ptr to a DWORD, not a ptr to a ptr as required for iUnknown.queryInterface
Leave a comment:
-
-
Get iEnumerator from nodelist
I am trying to get me the nodes via the enumerator.
problem is that the nodelist object is a late bound object.
So i was trying to use the interface pointer -4 to call the enumvariant interface.
Frankly i find the hard offsets a poor design.
Any luck i can keep using the late bound object and fetch me the enumerator anyway?
The enumerator is declared (early binding)
I seen code using Queryinterface but does not return an object:
Code:Local oUnk As IUnknown Local pEnum As Dword oUnk = oNodeList oUnk.QueryInterface( $IID_IEnumVARIANT, pEnum ) To hr
Tags: None
-
Leave a comment: