Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8178303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:43:50+00:00 2026-06-06T23:43:50+00:00

I’ve got an first chance exception in ppltasks.h’s _ContextCallback that I just don’t understand.

  • 0

I’ve got an first chance exception in ppltasks.h’s _ContextCallback that I just don’t understand.

My project is a mixed WinRT/native application. The application is made up of multiple sub-projects, one of them uses WinRT. The WinRT code is in a static library running in a different thread from the main thread (and it’s not in my power to change that). The WinRT code is copied from a generated Direct3D metro app in Visual Studio 2012 RC.

The code attempts to load one of the simple shaders:

void CubeRenderer::CreateDeviceResources()
{
    Direct3DBase::CreateDeviceResources();

    // going to crash while attempting to load a file.
    auto loadVSTask = DX::ReadDataAsync("SimpleVertexShader.cso");

The file exists, at the correct location, and proven to work.

The code crashes here. _M_context._M_pContextCallback is invalid.

   void _Reset()
    {
        if (_M_context._M_captureMethod != _S_captureDeferred && _M_context._M_pContextCallback != nullptr)
        {
            _M_context._M_pContextCallback->Release();
        }
    }

Output window gives:
First-chance exception at 0x00E34C89 in MyApplication.exe: 0xC0000005: Access violation reading location 0xCDCDCDCD.

Stack trace looks like:

MyApplication.exe!Concurrency::details::_ContextCallback::_Reset() Line 620 C++
MyApplication.exe!Concurrency::details::_ContextCallback::operator=(const Concurrency::details::_ContextCallback & _Src) Line 563 C++
MyApplication.exe!Concurrency::task_continuation_context::operator=(const Concurrency::task_continuation_context & __that) C++
MyApplication.exe!Concurrency::task::_ContinuationTaskHandle,std::integral_constant,Concurrency::details::_TypeSelectorAsyncOperation>::_ContinuationTaskHandle,std::integral_constant,Concurrency::details::_TypeSelectorAsyncOperation>(const std::shared_ptr > & _AncestorImpl, const std::shared_ptr > & ContinuationImpl, const DX::ReadDataAsync::_l3:: & _Func, const Concurrency::task_continuation_context & _Context, Concurrency::details::_TaskInliningMode _InliningMode) Line 3292 C++
MyApplication.exe!Concurrency::task::ThenImpl >(const DX::ReadDataAsync::_l3:: & _Func, Concurrency::details::_CancellationTokenState * _PTokenState, const Concurrency::task_continuation_context & _ContinuationContext, bool _Aggregating, Concurrency::details::_TaskInliningMode InliningMode) Line 3584 C++
MyApplication.exe!Concurrency::task::then< >(const DX::ReadDataAsync::
_l3:: & _Func) Line 2882 C++
MyApplication.exe!DX::ReadDataAsync(Platform::String ^ filename) Line 42 C++
MyApplication.exe!CubeRenderer::[Direct3DBase]::CreateDeviceResources() Line 30 C++

So there’s something wrong with the _ContextCallback, and that’s where I get stuck.

  • What is this context callback? It seems to have something to do with passing from a task to another.
  • If it’s invalid, how could that have happened?
  • If it’s simply just not setup properly, how to I properly set it up?

I can get it to work, but it involves changing all the sub-projects in the application to use WinRT. Unfortunately this is not considered an acceptable solution as the code in those other sub-projects are also outside of my control. I also would like to try to understand what’s actually going on here.

Any insights or ideas? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:43:51+00:00Added an answer on June 6, 2026 at 11:43 pm

    I’ve added a reference to ppltasks.h in my main cpp file. It makes the problem go away, but I have no idea why.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.