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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:13:56+00:00 2026-06-16T09:13:56+00:00

I consider myself pretty sharp with MFC, but I’ve ran into a problem lately

  • 0

I consider myself pretty sharp with MFC, but I’ve ran into a problem lately that I have not been able to find a fix for online, nor have I been able to trace it down myself…

The problem is, some code I wrote back at the start of the year, has been placed on hold due to an iOS project that came up, so I had spend about 5 months to write that, and now I’m ready to go back to the last project, but it appears to have suffered from Code Rot.

The problem is, it’s not Code Rot, there is actually a problem with my Build Env. I’m using VS2008, for various reasons that shouldn’t be the focus of the problem here anyways.

When I create a DEFAULT C++ MFC (Native) application, by simply creating the project, and then hitting FINISH on the wizard, then BUILD it, I get an error while the compiler is compiling the first CPP file. It APPEARS to compile stdafx.cpp just fine, which is including all the AFX headers, but what ends up happening is I get an error that “CDocument” is undefined… Now, I know enough MFC that this should just not be…

I’ve checked all my paths, and INCLUDE, LIB and so on, and they are all pointing to what is essentially

c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;c:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE

Along with some includes for the Windows SDK, and so on. The error I’m getting is showing that AFXWIN.H IS coming from the ATLMFC\INCLUDE folder.

So, by this point, I have to assume maybe I have something else wrong? Something updated some MFC DLL’s, or LIB’s, where they maybe should not have?

When I try to install from my VS2008 Team Foundation DVD (en_visual_studio_team_system_2008_team_suite_x86_x64wow_dvd_X##-####) either ISO or DVD, I just get an error when I attempt to launch the repair mode…

I’m not aware of any extended log files there might be to help track this down. (As to what the error is in the setup program while attempting to “repair” my VS2008 install, at least…)

I’m running on Win7, x86, with no UAC enabled. Has anyone else had a problem like this?

Thanks guys.

  • 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-16T09:13:58+00:00Added an answer on June 16, 2026 at 9:13 am

    I found the problem, and it is so bad, I don’t even want to answer this question, but I figure I better, because this could happen to someone else.

    This whole problem occurred while I was editing a project that did not use MFC at all, but it was loaded into the WORKSPACE of a project that DID use MFC. At one point, I did a “Find and Replace in Files”, for Document to XmlDocument. Well, little did I know, it would go out to my INCLUDE paths, and update the files there too. So, my MFC “CDocument” got changed into “CXmlDocument” in the afxwin.h file. (as well as afxwin.inl). It took a lot of searching on my part to find this, because I was wisked off that project on to another about 6 months ago. I come back to work on the ORIGINAL project that used MFC and waddaya know. Code-Rot. Well, since then a lot of changes happened to my PC, so I figured some new version of MFC got installed, or something. So, I went searching the include path of VS2010 for CXmlDocument, which did not exist! So, I figured, “Ok.. CXmlDocument is NOT a legit MFC Class.” So, I found where CDocument was declared, in VS2010, and matched it with what was in VS2008. It was then I started to realize what had happened. So, I replaced all instances of CXmlDocument with CDocument, and BAM! Code compiles just fine…

    So, the lesson for today Kids is if you do a search and replace in files, be DAMN CAREFUL what settings you use, and pay CLOSE attention to what files are modified!

    I’m sorry to everyone to read this question and wasted any time reading it, however I do appreciate the attempts to help me on this. Thank you guys/gals.

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

Sidebar

Related Questions

I consider myself still pretty new to the TDD scene. But find that no
I've been working with C and C# for ages, I consider myself a pretty
I'd consider myself a reasonable standard CSS/XHTML chap but I'm pretty baffled by this.
I've been developing for quite a while but while I consider myself competent (or
I'd consider myself an advanced web developer but I'm pretty stumped as to what
I consider myself pretty good with Regular Expressions, but this one is appearing to
So I would consider myself a .Net and ASP.NET pro but I am a
So I don't consider myself a novice at MySQL but this one has me
I still consider myself new to Java webservices, and I have hit a real
I'd consider myself advanced in getting smooth scrolling performance, but this has stumped me.

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.