Click here to Skip to main content
15,908,901 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help.... Pin
Michael P Butler9-Nov-01 4:06
Michael P Butler9-Nov-01 4:06 
GeneralRe: Help.... Pin
sardinka9-Nov-01 5:21
sardinka9-Nov-01 5:21 
GeneralRe: Help.... Pin
#realJSOP9-Nov-01 5:49
professional#realJSOP9-Nov-01 5:49 
GeneralRe: Help.... Pin
Christian Graus9-Nov-01 8:41
protectorChristian Graus9-Nov-01 8:41 
GeneralRe: Help.... Pin
moliate9-Nov-01 16:21
moliate9-Nov-01 16:21 
GeneralSearching Canvas for drawing diagrams... Pin
Braulio Dez9-Nov-01 3:17
Braulio Dez9-Nov-01 3:17 
GeneralRe: Searching Canvas for drawing diagrams... Pin
9-Nov-01 16:17
suss9-Nov-01 16:17 
GeneralPassing variable from one file to another Pin
Carine9-Nov-01 2:47
Carine9-Nov-01 2:47 
Hi there,

I'm a beginner of VC++, I would like to use CFileDialog to read in the name of the file that I need to open, and pass this variable to fileDoc.cpp to open the file, but I always encounter error. Could you pls help me!

MainFrame.h
class CMainFrame : public CFrameWnd
{

protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)

// Attributes
public:
CFileDoc* GetDocument();

// Operations
........
}

MainFrm.cpp
void CMainFrame::OnEditImport()
{
// TODO: Add your command handler code here
d_pOpenFile = new CFileDialog (TRUE);
iRet = d_pOpenFile->DoModal();

CFileDoc* pDoc = GetDocument();
pDoc->m_strName = d_pOpenFile->GetPathName();

pDoc->FindMax();

}

fileDoc.cpp
void CFileDoc::FindMax()
{
ClearBuf();

if((stream = fopen(m_strName,"r")) != NULL)
{
for(row =0; row <= 2000; row++)
........

}
Error Msg

c:\vcpp32\integration2\mainfrm.h(22) : error C2143: syntax error : missing ';' before '*'
c:\vcpp32\integration2\mainfrm.h(22) : error C2501: 'CFileDoc' : missing storage-class or type specifiers
c:\vcpp32\integration2\mainfrm.h(22) : error C2501: 'GetDocument' : missing storage-class or type specifiers
MainFrm.cpp
Generating Code...
Error executing cl.exe.

Can someone tell me wants wrong with my code?

Thank you!Confused | :confused:
GeneralRe: Passing variable from one file to another Pin
Stan Shannon9-Nov-01 3:00
Stan Shannon9-Nov-01 3:00 
GeneralRe: Passing variable from one file to another Pin
Carine9-Nov-01 3:13
Carine9-Nov-01 3:13 
GeneralRe: Passing variable from one file to another Pin
Stan Shannon9-Nov-01 6:39
Stan Shannon9-Nov-01 6:39 
GeneralRe: Passing variable from one file to another Pin
Stan Shannon9-Nov-01 6:45
Stan Shannon9-Nov-01 6:45 
QuestionEject CDROM in W98??? Pin
Jon Hulatt9-Nov-01 1:44
Jon Hulatt9-Nov-01 1:44 
AnswerRe: Eject CDROM in W98??? Pin
Tomasz Sowinski9-Nov-01 1:58
Tomasz Sowinski9-Nov-01 1:58 
AnswerRe: Eject CDROM in W98??? Pin
Carlos Antollini9-Nov-01 2:40
Carlos Antollini9-Nov-01 2:40 
AnswerRe: Check this ;) Pin
Masaaki Onishi9-Nov-01 4:17
Masaaki Onishi9-Nov-01 4:17 
GeneralRe: Check this ;) Pin
Alex Lewandowski9-Nov-01 4:40
Alex Lewandowski9-Nov-01 4:40 
GeneralRe: Ty, but... Pin
Masaaki Onishi9-Nov-01 5:23
Masaaki Onishi9-Nov-01 5:23 
GeneralWhich is faster TransparentBlt or AlphaBlend Pin
Chambers9-Nov-01 1:32
Chambers9-Nov-01 1:32 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Tomasz Sowinski9-Nov-01 1:54
Tomasz Sowinski9-Nov-01 1:54 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Chambers9-Nov-01 2:25
Chambers9-Nov-01 2:25 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Tomasz Sowinski9-Nov-01 2:36
Tomasz Sowinski9-Nov-01 2:36 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Chambers9-Nov-01 2:39
Chambers9-Nov-01 2:39 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Tomasz Sowinski9-Nov-01 2:43
Tomasz Sowinski9-Nov-01 2:43 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Chambers9-Nov-01 4:45
Chambers9-Nov-01 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.