locked
An outgoing call cannot be made since the application is dispatching an input-synchronous call

    Question

  • I got this exception "An outgoing call cannot be made since the application is dispatching an input-synchronous call" when I called some async function in

    callbacks from WinRT component.

    auto workItemDelegate = [this, &logs](Platform::Object^ sender, Windows::UI::Core::InvokedHandlerArgs^ e)
    	{			
    		this->OnPeriodicReport(this, logs->GetView());				
    	};
    
    //call UI Dispatcher
    GetUIDisptacher()->Invoke(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::InvokedHandler(workItemDelegate), this, nullptr);

    and in JS

    locService.onperiodicReport = function (eventObj) {
    ...
    Windows.Storage.KnownFolders.documentsLibrary.createFileAsync(filename, Windows.Storage.CreationCollisionOption.replaceExisting).then(function (file) {        
                return Windows.Storage.FileIO.writeTextAsync(file, content);
            }).done(function () { Msg("Successfully saved KML file in Document Library", "white");});
    }

    since I dispatch the work to UI thread, why it still not allow the async job to create file? Thanks for explanation.


    • Edited by Dong, Yi Friday, May 11, 2012 3:11 AM err
    Friday, May 11, 2012 3:07 AM

All replies

  • I am not sure.

    Can you post your project so I can reproduce this.

    Or you can Contact me and you can send me the project:

    http://blogs.msdn.com/jpsanders/contact.aspx

    -Jeff


    Jeff Sanders (MSFT)

    Monday, May 14, 2012 6:05 PM
    Moderator