Re: [OpenSIPStack] Problem with OnOutgoingCallConnected
Brought to you by:
joegenbaclor
From: Ilian J. C. P. <ip...@so...> - 2007-06-20 10:41:58
|
Hello. tomach wrote: > Hello! > > Ok call connections works fine etc... > I would like to ask how your activex works? > How your activex works? When call is created? is it working in separate thread then main winform application? Bacause I noticed that winforms do not hang and react normally so its ok (main thread is not stoped). > > But my problem is that when I run your application (sample VB) under visual studio events come but they do NOT update controls. When I run the same application under cmd line everything works fine events come and update controls. > > Do you had similar reaction under Visual Studio 2005? > Hmmm. Yep. ATLSIP events come from a separate thread... .NET is strict with regards to cross-thread UI updates (especially with VS 2005). You may need to marshall UI updates to the UI thread for the update to work. For example with the ATLSIP_OnOutgoingCallTrying event, instead of invoking lblStatus->Text directly from this separate thread you will need to tell the UI thread to do it. Like this: System::Void ATLSIP_OnOutgoingCallTrying( System::Object^ sender, AxATLSIPLib::_IOpenSIPStackCtlEvents_OnOutgoingCallTryingEvent^ e) { // lblStatus->Text = L"Status: Trying"; // This does not work SetText( lblStatus, L"Status: Trying" ); // This works. } delegate void SetTextCallback( Control^ control, String^ text); void SetText( Control^ control, String^ text ) { if ( control->InvokeRequired ) { // We are NOT on the UI thread so we need to marshal SetTextCallback^ settext = gcnew SetTextCallback( this, &OSSPhone::Form1::SetText ); this->Invoke( settext, gcnew array<Object^>{ control, text } ); } else { // We are on the UI thread. No need to marshal control->Text = text; } } The same logic applies with all other kinds of UI update. Anyway, this is .NET-specific stuff. You can search for .NET InvokeRequired for further reading. Regards, Ilian > I am really curious why is it happening? any suggestions? > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > > |