• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1388
  • Last Modified:

Enumerate UPnP device. Retrieve info from device.

Hi,
Looking at the code of PortForward at CodeProject (C++)
  -> www.codeproject.com/KB/IP/PortForward.aspx

I've noticed IUPnPDeviceFinder command. I would like to query the router
i'm currently connected to ...and get some info for the router like PortForward does.

Can someone provide some code with IUPnPDeviceFinder to get this info?

Thanks in advance.
Available info :

IUPnPDevice::IconURL()
IUPnPDevice::get_Property()
IUPnPDevice::get_Children()
IUPnPDevice::get_Description()
IUPnPDevice::get_FriendlyName()
IUPnPDevice::get_HasChildren()
IUPnPDevice::get_IsRootDevice()
IUPnPDevice::get_ManufacturerName()
IUPnPDevice::get_ManufacturerURL()
IUPnPDevice::get_ModelNumber()
IUPnPDevice::get_ModelName()
IUPnPDevice::get_ModelNumber()
IUPnPDevice::get_ModelURL()
IUPnPDevice::get_ParentDevice()
IUPnPDevice::get_PresentationURL()
IUPnPDevice::get_RootDevice()
IUPnPDevice::get_SerialNumber()
IUPnPDevice::get_Services()
IUPnPDevice::get_Type Uniform()
IUPnPDevice::get_UniqueDeviceName()
IUPnPDevice::get_UPC()

Open in new window

DeviceInfo.gif
0
CodedK
Asked:
CodedK
  • 3
1 Solution
 
thiagoblimeiraCommented:
Try these free components, they are wrappers around upnp api

http://www.whitebear.ch/upnp.htm
0
 
CodedKAuthor Commented:
Hi Thiagoblimeira.

Have you tried those components?
Their demo keeps crashing my PC.
There is no description on their page. I will try them.
0
 
CodedKAuthor Commented:
Thiagoblimeira i could not install those components on Delphi 2007...
I download some pas files that supposed to be there, but there are errors i cannot fix.
0
 
CodedKAuthor Commented:
For feature reference ...
I imported the Type library from C:\WINDOWS\System32\upnp.dll (UPNPLib_TLB).
You will get a freshly created UPNPLib_TLB file. Locate it, copy to the work folder.
In the uses clause add ->  "ActiveX, UPNPLib_TLB, ComObj"

Read MSDN how to do a callback :
http://msdn.microsoft.com/en-us/library/aa381561(VS.85).aspx

Drop a button and a memo in the form. Query the interface and :) worked perfectly.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now