Solved

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

Posted on 1997-12-04
1
1,059 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 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

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
Losing latter half of command line in Visual Studio C++ online program 10 89
White board coding practice 3 95
Header of docx file 17 132
Gaming Software 1 30
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

733 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