Click here to Skip to main content
15,889,876 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow can I read the attributes of files? Pin
ritz123418-Apr-08 2:23
ritz123418-Apr-08 2:23 
AnswerRe: How can I read the attributes of files? Pin
Rajesh R Subramanian18-Apr-08 2:45
professionalRajesh R Subramanian18-Apr-08 2:45 
AnswerRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 2:55
David Crow18-Apr-08 2:55 
GeneralRe: How can I read the attributes of files? Pin
ritz123418-Apr-08 3:05
ritz123418-Apr-08 3:05 
QuestionRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 3:09
David Crow18-Apr-08 3:09 
GeneralRe: How can I read the attributes of files? Pin
ritz123418-Apr-08 3:12
ritz123418-Apr-08 3:12 
GeneralRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 3:18
David Crow18-Apr-08 3:18 
GeneralRe: How can I read the attributes of files? Pin
ritz123418-Apr-08 3:42
ritz123418-Apr-08 3:42 
Hi David,

For testing pupose,

I've set the Timer and in the event of the timer I am trying to open the file.

I've run the application after manually openning the file.

After opening the file when I run the application it give me the message

of the file is opened.But when I close the file manually it doesn't give

the message of file is closed and I am getting the same message every

timer irrespective of the file is opened or not.Following is the code.

<br />
void CFilesDlg::OnTimer(UINT nIDEvent) <br />
{<br />
	// TODO: Add your message handler code here and/or call default<br />
	<br />
	CDialog::OnTimer(nIDEvent);<br />
<br />
	CFile ob;<br />
	BOOL res;<br />
	CFileException ex;<br />
	res=ob.Open("C:\\Documents and Settings\\Rigel\\Desktop\\SerialNumbers.txt",CFile::modeRead | CFile::shareExclusive, &ex);<br />
	if (!res)<br />
	{<br />
      <br />
      TCHAR szError[1024];<br />
      ex.GetErrorMessage(szError, 1024);<br />
	  MessageBox("The File is Closed");<br />
	  KillTimer(ID_TIMER1);<br />
	}<br />
	else<br />
	{<br />
		MessageBox("The File is opened");<br />
	}<br />
}<br />


ritz1234

GeneralRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 3:57
David Crow18-Apr-08 3:57 
GeneralRe: How can I read the attributes of files? Pin
ritz123418-Apr-08 4:01
ritz123418-Apr-08 4:01 
GeneralRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 4:06
David Crow18-Apr-08 4:06 
GeneralRe: How can I read the attributes of files? Pin
ritz123418-Apr-08 4:11
ritz123418-Apr-08 4:11 
QuestionRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 4:12
David Crow18-Apr-08 4:12 
GeneralRe: How can I read the attributes of files? Pin
ritz123418-Apr-08 4:19
ritz123418-Apr-08 4:19 
GeneralRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 4:39
David Crow18-Apr-08 4:39 
AnswerRe: How can I read the attributes of files? Pin
Hamid_RT18-Apr-08 20:29
Hamid_RT18-Apr-08 20:29 
GeneralDynamic c++ union or memory map Pin
Member 336349818-Apr-08 2:20
Member 336349818-Apr-08 2:20 
QuestionRe: Dynamic c++ union or memory map Pin
David Crow18-Apr-08 2:56
David Crow18-Apr-08 2:56 
GeneralRe: Dynamic c++ union or memory map Pin
Member 336349818-Apr-08 3:09
Member 336349818-Apr-08 3:09 
GeneralRe: Dynamic c++ union or memory map Pin
CPallini18-Apr-08 3:15
mveCPallini18-Apr-08 3:15 
GeneralDifference between XP and XPe Pin
FPeeters18-Apr-08 1:12
FPeeters18-Apr-08 1:12 
GeneralRe: Difference between XP and XPe Pin
Cedric Moonen18-Apr-08 2:40
Cedric Moonen18-Apr-08 2:40 
GeneralRe: Difference between XP and XPe Pin
FPeeters18-Apr-08 2:56
FPeeters18-Apr-08 2:56 
GeneralRe: Difference between XP and XPe Pin
Cedric Moonen18-Apr-08 3:06
Cedric Moonen18-Apr-08 3:06 
GeneralRe: Difference between XP and XPe Pin
FPeeters18-Apr-08 3:53
FPeeters18-Apr-08 3:53 

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.