[WRL] IRadioStatics.GetRadiosAsync()在x86中失败:80040154类未注册 [英] [WRL] IRadioStatics.GetRadiosAsync() fails in x86: 80040154 Class not registered

查看:126
本文介绍了[WRL] IRadioStatics.GetRadiosAsync()在x86中失败:80040154类未注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用C ++中的下一个代码来使用WRL检索系统上的无线电设备

I use next code in C++ to retrieve the radio devices on the system using WRL

	RoInitializeWrapper initialize(RO_INIT_MULTITHREADED);
	ComPtr<IRadioStatics> radioFactory;
	HStringReference classId(L"Windows.Devices.Radios.Radio");
	HRESULT hres = RoGetActivationFactory(classId.Get(), __uuidof(IRadioStatics), &radioFactory);
	ComPtr<IAsyncOperation<__FIVectorView_1_Windows__CDevices__CRadios__CRadio*>> asyncOperation;
	hres = radioFactory->GetRadiosAsync(&asyncOperation);
	asyncOperation->put_Completed
	( 
		Callback<IAsyncOperationCompletedHandler< __FIVectorView_1_Windows__CDevices__CRadios__CRadio* >> 
		(
			[](IAsyncOperation<__FIVectorView_1_Windows__CDevices__CRadios__CRadio* >* pHandler, AsyncStatus status)
			{
				// check status and use the stream here
				return S_OK;
			}
		).Get()
	);
	ComPtr<__FIVectorView_1_Windows__CDevices__CRadios__CRadio> radios;
	hres = asyncOperation->GetResults(&radios);
	unsigned int num;
	radios->get_Size(&num);
	wprintf_s(L"Radio devices found: %u\n", num);

编译为x64时它工作正常并返回找到的蓝牙无线电设备。

It works fine when compiled for x64 and returns my bluetooth radio device found.

但在x86中,此代码会导致下一个调试错误:

But in x86 this code causes next debug errors:

net \mobility\radiomanagement\winrt \lib \ radiomanager。 cpp(56)\ Windows.Devices.Radios.dll!0FDCD3CD :(来电者:0FDCF3A6)ReturnHr [PreRelease](1)tid(cf0)80040154未注册的班级

net\mobility\ radiomanagement\winrt\lib\radiomanager.cpp(39)\ Windows.Devices.Radios.dll!0FDCD2FE :(来电者:0FDCBD22)ReturnHr [PreRelease](2)tid(cf0)80040154未注册的课程

net \mobility\radiomanagement\winrt\lib\radioimpl.cpp(34)\ Windows.Devices.Radios.dll!0FDCBCBD :(来电者:0FDD5F9E)ReturnHr [PreRelease](3) tid(cf0)80040154未注册类别
net\mobility\radiomanagement\winrt\lib\utils.cpp(158)\ Windows.Devices.Radios.dll!0 FDD5AF3 :(来电者:0FDD1A83)ReturnHr [PreRelease](4)tid(cf0)80040154未注册类别
net \mobility\radiomanagement\winrt\lib\radiostaticsprivateserver.cpp(62 )\ Windows.Devices.Radios.dll!0FDD1A98 :(调用者:0FDC9CCF)LogHr(1)tid(cf0)80040154类未注册

net\mobility\radiomanagement\winrt\lib\radiomanager.cpp(56)\Windows.Devices.Radios.dll!0FDCD3CD: (caller: 0FDCF3A6) ReturnHr[PreRelease](1) tid(cf0) 80040154 Class not registered
net\mobility\radiomanagement\winrt\lib\radiomanager.cpp(39)\Windows.Devices.Radios.dll!0FDCD2FE: (caller: 0FDCBD22) ReturnHr[PreRelease](2) tid(cf0) 80040154 Class not registered
net\mobility\radiomanagement\winrt\lib\radioimpl.cpp(34)\Windows.Devices.Radios.dll!0FDCBCBD: (caller: 0FDD5F9E) ReturnHr[PreRelease](3) tid(cf0) 80040154 Class not registered
net\mobility\radiomanagement\winrt\lib\utils.cpp(158)\Windows.Devices.Radios.dll!0FDD5AF3: (caller: 0FDD1A83) ReturnHr[PreRelease](4) tid(cf0) 80040154 Class not registered
net\mobility\radiomanagement\winrt\lib\radiostaticsprivateserver.cpp(62)\Windows.Devices.Radios.dll!0FDD1A98: (caller: 0FDC9CCF) LogHr(1) tid(cf0) 80040154 Class not registered

...并返回任何设备。

... and any device is returned.

我们将不胜感激任何帮助。

Any help will be appreciated.

谢谢。

推荐答案

什么是IRadioStatics以及您创建了64位或32位的dll类型我认为由于混合模式而出现问题。确保在创建32位应用程序时也使用32位版本的IRadioStatics。

What is IRadioStatics and what type of dll you had created 64 bit or 32 bit I think you are getting issue due to mix mode . Make sure you are also using 32 bit version of IRadioStatics while creating your 32 bit app.

谢谢


这篇关于[WRL] IRadioStatics.GetRadiosAsync()在x86中失败:80040154类未注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆