Hi Thomas,

I have checked out the dyndispatch branch, and have given it a quick 
test run.

It is working great so far :) at least 
comtypes.client.CreateObject(blablabla,dynamic=True) is giving back a 
dynamic dispatch, and any methods I call on that dynamic dispatch are 
giving back dynamic dispatches (when they support it).

I understand work still needs to be completed for how dynamic dispatch 
properties and methods are handled, but so far this all looks really 
good from my end.

Thanks again for looking in to this for me

Mick



Thomas Heller wrote:
> Michael Curran schrieb:
>    
>> Hi Thomas,
>>
>> I really appreciate you taking the time to look at my patch, many thanks.
>>
>> The idea about adding a dynamic keyword arg to createObject etc sounds
>> fine to me. I had talked about this idea with another developer on my
>> project, but we couldn't work out the best way to have invoke not
>> generate code. Your idea about having a dyn_value on a variant sounds good.
>>      
>
> I have started to implement this idea in a branch now:
>
> https://comtypes.svn.sourceforge.net/svnroot/comtypes/branches/dyndispatch
>
>    
>> I'm sure this will all work with the way you have proposed, but I would
>> like to note, just so it is taken in to consideration, that when we use
>> comtypes in NVDA, we generally don't make use of CreateObject etc, but
>> rather we create a NULL interface pointer for the interface we are
>> interested in, and then using byref, we use particular win32 api
>> functions such as AccessibleObjectFromEvent in oleacc.dll to place the
>> real pointer value in our pointer. This is because much of the time we
>> retreave COM pointers from particular Windows etc.
>>
>> So all I guess I'm saying here is that one of our use patterns with
>> comtypes would be starting straight from an IDispatch which was
>> arbitrarily retreaved, not necessarily through createObject etc. So as
>> long as we can create a dynamic dispatch object with what ever means we
>> see fit, and what ever attributes we ask for no code is generated, than
>> this is fine.
>>      
>
> Well, it all depends on what you do with the IDispatch pointer you received.
> You can pass it to comtypes.client.GetBestInterface(pdisp), and comtypes
> will try to generate the code if it find a typelib,  or you pass it to
> comtypes.client.dynamic._Dispatch(pdisp) which will then use dynamic
> dispatch.  That is also what comtypes.client.CreateObject() does, depending
> on the 'dynamic=...' parameter.
>
>    

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to