Solved

CString and Link Errors

Posted on 1998-04-12
5
186 Views
Last Modified: 2010-04-10
I asked why I got all those error. This is not a question but the answer for the experts who tried to help.  I appreciate that.The real problem was that the code was sent to me by someone using an newer compiler and he used the header stdafx.h. That is not where CString is defined in VC 4.0. It is in afx.h..... I got a compile and run after that simple change....
0
Comment
Question by:Cyberdater
  • 2
  • 2
5 Comments
 

Author Comment

by:Cyberdater
ID: 1184226
Edited text of question
0
 
LVL 22

Expert Comment

by:nietod
ID: 1184227
Thanks for letting us know.
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 0 total points
ID: 1184228
Your stdafx.h should INCLUDE afx.h anyway.

Try creating a new project with AppZiard and get the stdafx.h from that.

0
 

Author Comment

by:Cyberdater
ID: 1184229
I generated both an Application and Console workspace before and after I inserted the .cpp.  Also if I include stdafx.h as well as afx.h I get into errors.  I read the stdafx.h and it does contain afx.h in the core headers.  Something really odd to me is that stdafx.h is located in mfcdevstd\mfc\src instead of mfcdevstd\mfc\include and the applications cannnot find it until I put the src into the include paths under options..directory.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1184230
you should have your own stdafx.h (make a copy of the one in MFC source or use the one AppWizard writes for you).  Don't directly refer to the one in MFC source area.

do NOT put any code or preprocessor statments before #include "stdafx.h" as any lines there are ignored when precompiled headers are used.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Prototype for MessageDlg in Embacadero XE 2 2 35
I could not build boost code, 10 78
Embarcadero WebBroker REST server endpoint parameters 2 54
max float value 3 25
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now