【发布时间】:2015-06-15 22:03:06
【问题描述】:
我用自己的后台线程制作了进程外 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 文件 - 它们包含一些事件代码。
这个问题可能是什么原因造成的?
【问题讨论】:
标签: c++ events windows-phone-8 out-of-process