[python-win32] Problems with Python+COM and XP Firewall Manager

Jens B. Jorgensen jens.jorgensen at tallan.com
Thu Oct 23 20:00:11 EDT 2003


Interesting. I would think that would work actually. Hmm. Actually the 
reason that call doesn't work is because the InvokeTypes call is 
attempting to turn the argument (which is the INetConnection *) into 
VT_DISPATCH, which cannot be done since that interface doesn't support 
IDispatch. I'm not sure where the mistake was made but perhaps when the 
type library was processed it was assumed that the INetConnection 
interface would support IDispatch which of course it does not. I think 
this is technically a bug in makepy. You can actually fix this by 
modifying the hnet.py that was generated by makepy. Go to the line in 
there where it defines INetSharingConfigurationForINetConnection there 
is a line there with "InvokeTypes(0x6, LCID, 2, (9, 0), ((9, 1)"... and 
change the bit with "((9, 1)" to "((13, 1)" and now the code should 
work. If I had more time to spare at the moment looking at this I'd 
figure out a patch for makepy and send it on to Mark.

Robert Olson wrote:

> At 03:11 PM 10/23/2003, Jens B. Jorgensen wrote:
>
>> Ack. Sorry, yeah. I updated the zip and uploaded it to the same spot.
>
>
> Okay, that built and works fine. very cool.
>
> What I'm actually looking for is the ability to call 
> INetSharingManager::get_INetSharingConfigurationForINetConnection. 
> What I'm thinking is I add a call that takes the netsharingmgr 
> instance and the netconn IUnknown guy, convert the later to a 
> INetConnectionPtr, and do the invocation.
>
> Can you point me at the magic to convert a python 
> <win32com.gen_py.NetCon 1.0 Type Library.NetSharingManager> into the 
> C++ INetSharingManager object, and the other direction for the return 
> of the INetSharingConfiguration object (which does implement IDispatch 
> which means I should be able to manipulate it in python).
>
> thanks; this is pretty powerful stuff ..
>
> --bob 


-- 
Jens B. Jorgensen
jens.jorgensen at tallan.com

"With a focused commitment to our clients and our people, we deliver value through customized technology solutions."





More information about the Python-win32 mailing list