我有一个VisualStudio2008WindowsMobile 6 C++项目,在这里我想注册一个UPnP服务。
我正在使用WindowsCE6SDK中的Microsoft示例作为UPnP服务的实现。WINCE600\PUBLIC\SERVERS\SDK\SAMPLES\UPNP\DEVICE
不幸的是,RegisterRunningDevice调用由于错误E_HANDLE而失败。
#include "upnpdevice_i.c"
#import "upnpdevice.dll" named_guids
int main()
{
::CoInitializeEx( NULL, COINIT_MULTITHREADED );
using namespace UPnPHostLib;
IUPnPDeviceControlPtr device_ctrl( CLSID_Device );
IUPnPRegistrarPtr registrar( CLSID_UPnPRegistrar );
bstr_t device_descr = /* contents of the device.xml file from the sample */
// throws a _com_error exception where hr = E_HANDLE
bstr_t device_id = registrar->RegisterRunningDevice( device_descr,
device_ctrl,
L"foo",
L"/windows/upnp",
0 );
/* ... */
::CoUninitialize();
return 0;
}我见过其他人在我的网络搜索中提到这个错误,但我没有看到任何结果。
/windows/upnp目录中。有人有什么建议吗?
发布于 2012-07-18 15:08:25
我已经解决了。问题是可选组件没有签署。当device.exe试图在引导时将它们作为流驱动程序加载时,它们被拒绝了。
-PaulH
https://stackoverflow.com/questions/11528916
复制相似问题