Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CString and Link Errors

Posted on 1998-04-12
5
189 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Template syntax for variable length arrays 9 75
Printing the elements of a set declared inside a map in C++. 3 52
Safe conversion? 4 72
Outlook 13 41
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

840 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