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 8892913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:07:31+00:00 2026-06-14T23:07:31+00:00

I am getting access violations in mfc90d.dll in CObject:IsKindOf , the deepest item on

  • 0

I am getting access violations in mfc90d.dll in CObject:IsKindOf, the deepest item on the call stack, which is actually apparently run long before WinMainCRTStartup is, and which probably is in my app because I wrote a standard container of some of my application’s model objects; std::map<int, CDevice*> somewhere, leading to the following templated container C++ type existing, and then showing up in my call stack:

myapp.exe!std::_Tree<std::_Tmap_traits<int,CDevice   
         *,std::less<int>,std::allocator<std::pair<int const ,CDevice *> >,0> 
          >::_Copy(const std::_Tree<std::_Tmap_traits<int,CDevice 
         *,std::less<int>,std::allocator<std::pair<int const ,CDevice *> >,0> > &                     
         _Right={...})  Line 1067 + 0x1d bytes  C++

I am not 100% sure that the std::map<int, CDevice*> is the reason, but it’s the only templates reference involving “CDevice*” that I could find.

The whole call stack, given slightly simplified (ellipsis ... indicates omission of some details of the function signature).

mfc90d.dll!CObject::IsKindOf(const CRuntimeClass * pClass=0x691a09ec)  
mfc90d.dll!CDocManager::OpenDocumentFile(const char * lpszFileName=0x007783e8)  
mfc90d.dll!CWinApp::OpenDocumentFile(const char * lpszFileName=0x007783e8)  
myapp.exe!CServerApp::InitInstance()  
mfc90d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * ...            
    myapp.exe!__tmainCRTStartup()  Line 574 + 0x35 bytes    C
myapp.exe!WinMainCRTStartup()  Line 399 C
kernel32.dll!762033aa()     
ntdll.dll!77369ef2()    
ntdll.dll!77369ec5()    
myapp.exe!std::_Tree<std::_Tmap_traits<int,CDevice ..........

Questions:

  1. I’m a bit mystified about how something like std::_Tree<...>::_Copy can be executing so many layers of stuff FOUR entire call layers layers above myapp.exe!WinMainCRTStartup. Should I suspect the callstack above of being incorrect?

  2. What’s an std::_Tree<…> mess like the above there for and why is it invoking CObject:IsKindOf? My code uses the STL like this: std::map<int, CDevice*>.
    My guess is that if I removed all references to std::map<int, CDevice*> then the
    above std::_Tree internal implementation code would go away.

  3. Running this far before WinMainCRTStartup suggests to me that this code is actually run when the mfc90d.dll loads. Is that probably so? Is there anything I can do in VC++2008 debugger to get a clearer view of “when is this code running?”

  4. It’s unreasonable to ask for someone to guess for me how on earth crashes can occur
    this early in my application’s lifetime. I am interested in how you debug such problems though, so if any of this rings a bell for you, I’d appreciate your thoughts and ideas, but it’s too much to ask anybody to guess what’s really going on. Let’s just say it’s random heap corruption, somehow. But if you have tips on the order of “switch from using MFC in a dll to statically linking MFC”, I’d like to hear those.

  • 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-14T23:07:33+00:00Added an answer on June 14, 2026 at 11:07 pm

    Anything below ntdll.DLL is a red herring, in my experience. Your std map did not call code in ntdll which called win main. The debugger is interpreting nonsense and trying to makes sense of it, and some semi random binary data had an address that lined up with one of your functions. Pretend it is not there.

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

Sidebar

Related Questions

I'm getting an Access Violation in DBEXPSDA40.DLL (Dev Art MS SQL Server dbexpress driver)
I am getting access violation error when I run the following code on Visual
I'm getting a memory access violation which i am not able to figure out.
I'm getting access violations from the unit DBXCommon.pas (in Delphi XE). When I look
I'm getting a (to me) weird run-time access violation error. I have a class,
I am continuously getting an Access Violation Error with a all my kernels which
I am getting an access violation error in an unmanaged dll I am writing,
I'm getting an access violation on a char array I just created using new
I am getting an unexpected Access Violation error in the following code: program Project65;
I'm having trouble getting access to my WPF UserControl DependencyProperty values through the UI

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.