locked
backgound task in C++ giving "First Chance exception-WinRT originate error"

    Question

  • I am creating a BGTask in C++ using a TimeZoneTrigger and while debugging it I noticed that though my code does not break at the "Run" method of my BGTask class when the time-offset changes ,but still there is some output in the console screen when I change the time-zone.The output says some "WinRT originate error" and am pasting it below.Please suggest what could be the solution to this problem

    P.S. - I found that someone posted the same problem on this forum and his error got resolved when he added references to his "Bgtask" project in the Metro app.I have already done so but still getting the error

    First-chance exception at 0x000007FF1834DECC (KernelBase.dll) in backgroundTaskHost.exe: 0x40080201: WinRT originate error (parameters: 0x0000000080004002, 0x000000000000001D, 0x000000CC6257DA20).
    'backgroundTaskHost.exe' (Win32): Unloaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.110.Debug_11.0.50522.1_x64__8wekyb3d8bbwe\msvcp110d.dll'
    'backgroundTaskHost.exe' (Win32): Unloaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.110.Debug_11.0.50522.1_x64__8wekyb3d8bbwe\msvcr110d.dll'
    'backgroundTaskHost.exe' (Win32): Unloaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.110.Debug_11.0.50522.1_x64__8wekyb3d8bbwe\vccorlib110d.dll'
    'backgroundTaskHost.exe' (Win32): Unloaded 'C:\Users\gaura_000\Documents\Visual Studio 2012\Projects\lockscrtask\x64\Debug\lockscrtask\AppX\task.dll'
    'backgroundTaskHost.exe' (Win32): Unloaded 'C:\Windows\System32\biwinrt.dll'
    'backgroundTaskHost.exe' (Win32): Unloaded 'C:\Windows\System32\actxprxy.dll'
    'backgroundTaskHost.exe' (Win32): Unloaded 'C:\Windows\System32\WinTypes.dll'
    The thread 0x14b0 has exited with code 0 (0x0).
    The thread 0x13ec has exited with code 0 (0x0).
    The thread 0x23ec has exited with code 0 (0x0).
    The thread 0xf88 has exited with code 0 (0x0).
    The program '[2676] backgroundTaskHost.exe' has exited with code 0 (0x0).
    The thread 0xf00 has exited with code 1 (0x1).
    The thread 0x1fcc has exited with code 1 (0x1).
    The thread 0xe2c has exited with code 1 (0x1).
    The thread 0x16b4 has exited with code 1 (0x1).
    The thread 0xd7c has exited with code 1 (0x1).
    The thread 0x504 has exited with code 1 (0x1).
    The thread 0x15b4 has exited with code 1 (0x1).
    The thread 0xc10 has exited with code 1 (0x1).
    The program '[5896] lockscrtask.exe' has exited with code 1 (0x1).



    • Edited by gaurav_kl Friday, June 15, 2012 6:51 AM
    Friday, June 15, 2012 6:41 AM

Answers

  • Hi

    My problem is resolved.

    Earlier I didn't add references to my "task" project and later on starting fresh I forgot to inherit the "IBackgroundTask" interface

    Friday, June 15, 2012 5:22 PM

All replies

  • Hi

    My problem is resolved.

    Earlier I didn't add references to my "task" project and later on starting fresh I forgot to inherit the "IBackgroundTask" interface

    Friday, June 15, 2012 5:22 PM
  • Thanks for posting back with your solution! Saved me some time investigating and also explains the 0x80004002 error (E_NOINTERFACE) above.


    David Lamb

    Friday, June 15, 2012 5:28 PM
    Moderator