Click here to Skip to main content
15,914,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MoveWindow/SetWindowPos both flicker Pin
Christian Graus17-Oct-01 20:41
protectorChristian Graus17-Oct-01 20:41 
GeneralRe: MoveWindow/SetWindowPos both flicker Pin
Michael Dunn17-Oct-01 21:25
sitebuilderMichael Dunn17-Oct-01 21:25 
Generaloverloaded insertion operator Pin
17-Oct-01 16:19
suss17-Oct-01 16:19 
GeneralRe: overloaded insertion operator Pin
kumar_p317-Oct-01 17:03
kumar_p317-Oct-01 17:03 
GeneralVariable argument lists Pin
#realJSOP17-Oct-01 13:23
professional#realJSOP17-Oct-01 13:23 
GeneralRe: Variable argument lists Pin
Christian Graus17-Oct-01 16:26
protectorChristian Graus17-Oct-01 16:26 
GeneralRe: Variable argument lists Pin
#realJSOP18-Oct-01 2:41
professional#realJSOP18-Oct-01 2:41 
GeneralUndeclared identifer message Pin
Sam C17-Oct-01 12:29
Sam C17-Oct-01 12:29 
Hi,

Why does the following code generate a compile error of C2065 in VC 6++

//Beginning of function
CStdioFile myFile; <-Why do I have to do this to avoid the compile error C2065 (Undeclared identifier)

TRY
{
  CStdioFile myFile((LPCTSTR)m_FilePath, CFile::modeRead | CFile:: typeText);
}
CATCH (CFileException, err)
{
   MessageBox("Can't open file",...);
   //Other lines to set focus to another control
}
END_CATCH

//ASSERT(myFile.m_pStream!=NULL) <- Asserts here
Maui.File.SeekToBegin();  <-Asserts here due to Null reference


To get the asserts I had to put a variable declaration of CStdioFile myFile at the top of the function. This is because of the error I get with "Undelcared identifier". I don't get it isn't it already being declared in the TRY...CATCH block? And why is it when I make a forward declaration it still asserts at the following two lines after END_CATCH?

Really confused Confused | :confused: Please help.

Sam C
----
Systems Manager
Hospitality Marketing Associates
GeneralRe: Undeclared identifer message Pin
Tomasz Sowinski17-Oct-01 12:33
Tomasz Sowinski17-Oct-01 12:33 
GeneralRe: Undeclared identifer message Pin
Sam C17-Oct-01 12:39
Sam C17-Oct-01 12:39 
GeneralRe: Undeclared identifer message Pin
Fazlul Kabir17-Oct-01 12:36
Fazlul Kabir17-Oct-01 12:36 
GeneralRe: Undeclared identifer message Pin
Sam C17-Oct-01 12:42
Sam C17-Oct-01 12:42 
GeneralRe: Undeclared identifer message Pin
Fazlul Kabir17-Oct-01 12:47
Fazlul Kabir17-Oct-01 12:47 
GeneralConverting ... Pin
Hadi Rezaee17-Oct-01 12:23
Hadi Rezaee17-Oct-01 12:23 
GeneralRe: Converting ... Pin
Christian Graus17-Oct-01 16:26
protectorChristian Graus17-Oct-01 16:26 
GeneralRe: Converting ... Pin
Hadi Rezaee18-Oct-01 12:25
Hadi Rezaee18-Oct-01 12:25 
GeneralRe: Converting ... Pin
Christian Graus18-Oct-01 12:28
protectorChristian Graus18-Oct-01 12:28 
GeneralRe: Converting ... Pin
Hadi Rezaee18-Oct-01 12:53
Hadi Rezaee18-Oct-01 12:53 
GeneralADO question 1 ... Pin
Hadi Rezaee17-Oct-01 12:20
Hadi Rezaee17-Oct-01 12:20 
GeneralRedraw a control.. Pin
RobJones17-Oct-01 12:19
RobJones17-Oct-01 12:19 
GeneralRe: Redraw a control.. Pin
Fazlul Kabir17-Oct-01 12:27
Fazlul Kabir17-Oct-01 12:27 
GeneralRe: Redraw a control.. Pin
RobJones17-Oct-01 12:29
RobJones17-Oct-01 12:29 
GeneralModeless Dialog Inside a Frame Pin
Mark Lenz17-Oct-01 10:43
Mark Lenz17-Oct-01 10:43 
GeneralRe: Modeless Dialog Inside a Frame Pin
RobJones17-Oct-01 11:41
RobJones17-Oct-01 11:41 
GeneralRe: Modeless Dialog Inside a Frame Pin
Mark Lenz18-Oct-01 3:16
Mark Lenz18-Oct-01 3:16 

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.