[python-win32] Using win32com to access uPNP

s4fu-oirs at spamex.com s4fu-oirs at spamex.com
Fri Apr 16 19:17:34 EDT 2004


Hi --
 
I'm trying to use the interface in win32com to access the windows uPNP
service, the code is as follows:

import win32com.client

theNatter = win32com.client.Dispatch("HNetCfg.NATUPnP")

mappingPorts = theNatter.StaticPortMappingCollection

At this point mappingPorts seems to contain the null object, so it would
appear that theNatter doesn't have an attribute StaticPortMappingCollection
though the msdn docs claim otherwise.

Also, i notice there are a number of interfaces common to HNetCfg.dll and
NATUPnP - how does the above code differntiate between them ?

-- 
 




More information about the Python-win32 mailing list