c++ - Windows Runtime (WP 8) out of process component and raising / subscription events -
c++ - Windows Runtime (WP 8) out of process component and raising / subscription events -
i've made out-of-process wr/wp8 component own background thread. handles sip stack internally , runs in background thread. modified code chatterbox msdn example. https://code.msdn.microsoft.com/windowsapps/chatterbox-voip-sample-app-b1e63b8b
last days add together delegates raise events component. in c++/cx is:
public delegate void onlogmessage(platform::string^ msg); public ref class logger sealed { public: logger(); virtual ~logger(); void flushlog(); event onlogmessage^ onlogmessage; }; there subscription event in c# code:
backgroundprocesscontroller.instance.logger.onlogmessage += new inttalk.onlogmessage(mlogger_onlogmessage); it builds ok.
but during debug see exception:
a first chance exception of type 'system.exception' occurred in mscorlib.ni.dll additional information: interface not registered (exception hresult: 0x80040155) if there handler exception, programme may safely continued. proxy stub dll generated. checked .h/.c files - include code events.
what can cause of issue?
when debugging in native mode same code observed "interface not registered" exception. short search resulted in reference:
'interface not registered' error on atl out-of-process callback interface
but utilize c++/cx, no idl @ all. checked chatterbox demo (which starting point voip application) - not utilize windows runtime events @ all.
so stopped attempts in direction.
another possible ways can be:
use queue of custom event structures, poll , handle event c# side. use interface declared in c++/cx event handler. implement interface on c# side. not sure if marshall events main ui thread however. c++ events windows-phone-8 out-of-process
Comments
Post a Comment