我用自己的后台线程制作了进程中的WR/WP8组件。它在内部处理SIP堆栈,并在后台线程中运行。它是从ChatterBox MSDN示例中修改的代码。https://code.msdn.microsoft.com/windowsapps/ChatterBox-VoIP-sample-app-b1e63b8b
最后几天,我添加委托来从组件中引发事件。在C++/CX中是:
public delegate void OnLogMessage(Platform::String^ msg);
public ref class Logger sealed
{
public:
Logger();
virtual ~Logger();
void FlushLog();
event OnLogMessage^ OnLogMessage;
};在C#代码中有对事件的订阅:
BackgroundProcessController.Instance.Logger.OnLogMessage += new IntTalk.OnLogMessage(mLogger_OnLogMessage);它造得很好。
但是在调试期间,我看到了异常:
A first chance exception of type 'System.Exception' occurred in mscorlib.ni.dll
Additional information: Interface not registered (Exception from HRESULT: 0x80040155)
If there is a handler for this exception, the program may be safely continued.生成代理存根DLL。我检查了.h/.c文件--它们包括一些事件代码。
造成这一问题的原因是什么?
发布于 2015-06-03 18:50:17
在本机模式下调试时,我观察到的相同代码是“接口未注册”异常。通过简短的搜索,得到了以下参考:
'Interface not Registered' error on ATL out-of-process callback interface
但是我使用C++/CX,根本没有IDL。我检查了ChatterBox演示程序(这是我的VoIP应用程序的起点)--它们根本不使用。
所以我停止了朝这个方向的尝试。
另一种可能的办法是:
https://stackoverflow.com/questions/29557133
复制相似问题