C++ 如何注册UPnP服务
我使用WindowsCE6SDK中的Microsoft示例作为UPnP服务的实现。WINCE600\PUBLIC\SERVERS\SDK\SAMPLES\UPNP\DEVICE 不幸的是,C++ 如何注册UPnP服务,c++,windows-mobile,windows-ce,upnp,C++,Windows Mobile,Windows Ce,Upnp,我使用WindowsCE6SDK中的Microsoft示例作为UPnP服务的实现。WINCE600\PUBLIC\SERVERS\SDK\SAMPLES\UPNP\DEVICE 不幸的是,RegisterRunningDevice调用失败,并带有错误E\u句柄 #include "upnpdevice_i.c" #import "upnpdevice.dll" named_guids int main() { ::CoInitializeEx( NULL, COINIT_MULTITH
RegisterRunningDevice
调用失败,并带有错误E\u句柄
#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;
}
在我的网络搜索中,我看到其他人提到了这个错误,但我没有看到任何结果
- 我已经注册了upnpdevice.dll
- 我已经安装了“可选的Windows Mobile服务器组件”upnpctrl、upnphost和httpd
- 可执行文件upnpdevice.dll、device.xml和service.xml文件都位于
目录中/windows/upnp
有人有什么建议吗?我已经解决了。问题是这份协议没有签署。当device.exe试图在引导时将它们作为流驱动程序加载时,它们被拒绝 -保罗