?
Solved

MFC C++ file I/O using CStdioFile text file

Posted on 1997-12-04
1
Medium Priority
?
1,086 Views
Last Modified: 2008-02-01
This should be easy for anyone knowing MFC and C++ (not me)
I've created a dialog box application using MFC which just opens a CStdioFile text file for output, prompts for data and writes the data to the file.

I've created a class based on CStdioFile and open the file in the main module.
When I try to reference that class in my dialogbox module I get an undeclared variable compiler error.
The dialog box code doesn't know about the class that was declared in the main routine.  The sample code Microsoft provides is something short of helpful (along with the 3 C++ books I've bought.)
Esto mi hode.
 
0
Comment
Question by:jdn
[X]
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
1 Comment
 
LVL 3

Accepted Solution

by:
gaohong earned 200 total points
ID: 1174840
You have to include the include file where you redefined
CStdioFile's behaviour, then declare an variable of type
CStdioFile or whatever you redefined type, then use that
variable.

good luck
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

752 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