IT Community - Software Programming, Web Development and Technical Support

Could not iterate UPNP services of a device using microsoft UPNP.DLL.Please let Me kn

This is a discussion on Could not iterate UPNP services of a device using microsoft UPNP.DLL.Please let Me kn within the Windows Mobile forums, part of the Mobile Software Development category; Hi Friends, I am facing a problem with Microsoft upnp.dll, I have 5.1.2600.2180 of upnp.dll. ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Mobile Software Development > Windows Mobile

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-25-2007, 12:30 AM
theone theone is offline
D-Web Sr.Programmer
 
Join Date: Jun 2007
Posts: 129
theone is on a distinguished road
Question Could not iterate UPNP services of a device using microsoft UPNP.DLL.Please let Me kn

Hi Friends, I am facing a problem with Microsoft upnp.dll, I have 5.1.2600.2180 of upnp.dll.
I wrote both VC++ as well as C# code; but could not iterate the device services. I also used get__item functions of IUPNPDevices and IUPNPServices but both returned null reference. I am sending you C# code snippet.
Code Snippet
using UPNPLib;
private void btnOK_Click(object sender, EventArgs e) {
try {
UPnPDeviceFinder pDeviceFinder = new UPnPDeviceFinder();
// get device list for DEVICE URN
UPnPDevices pDevices = pDeviceFinder.FindByType("urn:schemas-upnp-org:device:Printer:1", 0);
foreach (UPnPDevice pDevice in pDevices)
{
if (pDevice != null)
{ MessageBox.Show(pDevice.FriendlyName);
// get device services
UPnPServices pServices = pDevice.Services;

// While iterating the services it goes to catch block. Exception messge is "Exception from HRESUT:0X80040500"
foreach (UPnPService pService in pServices)
{
if (pService != null)
MessageBox.Show(pService.Id.ToString());
}
}
}
}
catch (Exception ex)
{ MessageBox.Show(ex.Message); }
}
I tried the code both in VC++ and C#, it could not able to iterate services with both languages. I also used get__item functions of IUPNPDevices and IUPNPServices but both returned null reference. Please let me know the problem cause.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 07-27-2007, 05:18 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 632
oxygen is on a distinguished road
Thumbs down Re: Could not iterate UPNP services of a device using microsoft UPNP.DLL.Please let M

Hi

the error code you are seeing is UPNP_E_INVALID_DOCUMENT - it suggests, that your device has invalid device description document. The error is actually on the device side

Oxygen
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Detect the Bluetooth Device sudha Mobile Software Development 0 04-28-2008 02:31 AM
The device is not ready. at System.IO kingmaker C# Programming 3 02-16-2008 09:32 AM
Microsoft delivered a new version of its Microsoft Security Assessment Tool (MSAT) senthilkannan Microsoft 0 12-19-2007 02:47 AM
Microsoft Developing A Double-Sided Touch Screen Device vadivelanvaidyanathan Technology BUZZzzzzz 0 08-30-2007 10:58 PM
Default Boot Device vigneshgets Operating Systems 0 07-18-2007 02:36 AM


All times are GMT -7. The time now is 02:23 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0