views:

25

answers:

0

This library comes with windows, in the windows\system32 directory, if you register it and type the following code (C#/VB.Net/VB6/Delphi either is fine):

Dim devices As UPNPLib.UPnPDevices = New UPNPLib.UPnPDevices
MsgBox(devices.Count)

I keep getting 0, but i know this cannot be true because if i do a FindByUDN (in the UPnPDeviceFinder class) i get a reference to my router, which i can then use. However, my router (and other UPnP devices) are not showing in the UPnPDevices Collection (ie: .Count returning 0) and i really need to be able to get a list of all the devices.

If you have free time, could you try the above code and let us know what you get? Otherwise, if you have any information as to why i am experiencing this I would really appreciate your input.

And yes, i have even tried Intels (now gone open source) UPnP for Developers and it has absolutely 0 documentation (nothing) and could not find a way to 'guess' its implementation using intellisense alone - crazy.

Hope to hear from someone - thanks.

. . .

Update:

Turns out you need to populate the collection manually by using something like...

Dim x as upnpDeviceFinder
devices = x.FindByType("upnp:rootdevice", 0)

then you can run through the collection as per usual, and to re-clarify, i assumed the devices collection's constructor initialized and populated the elements for all devices, but it doesn't do this, not for a single one. i still need a way to get 'all devices' though...

so... i still have a problem as there is no proper documentation on that sorts and types of possible combination of values you can pass to the first argument of .FindByType (ie: in place of the "upnp:rootdevice" that i used in my example, and the protocol specifications are a nightmare to try to read and figure out the relevant parts - not possible really. i think protocol spec authors judge the value of their doco's depending on how difficult they can make it (by sounding uber-professional) to comprehend by readers... similar to RFC documents!

anyway, any ideas or leads on this would be great :)