Solved

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

Posted on 1997-12-04
1
1,029 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
1 Comment
 
LVL 3

Accepted Solution

by:
gaohong earned 50 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
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 viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

758 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

22 Experts available now in Live!

Get 1:1 Help Now