Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1130
  • Last Modified:

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

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
jdn
Asked:
jdn
1 Solution
 
gaohongCommented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now