Click here to Skip to main content
15,912,837 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Conversion.. Pin
Ryan Binns26-Jun-03 0:50
Ryan Binns26-Jun-03 0:50 
GeneralRe: Conversion.. Pin
Anonymous26-Jun-03 2:14
Anonymous26-Jun-03 2:14 
GeneralRe: Conversion.. Pin
Ryan Binns26-Jun-03 2:22
Ryan Binns26-Jun-03 2:22 
GeneralRe: Conversion.. Pin
Anonymous26-Jun-03 6:10
Anonymous26-Jun-03 6:10 
GeneralRe: Conversion.. Pin
basementman26-Jun-03 6:42
basementman26-Jun-03 6:42 
GeneralI have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
kydfru25-Jun-03 20:37
kydfru25-Jun-03 20:37 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
Ryan Binns26-Jun-03 0:56
Ryan Binns26-Jun-03 0:56 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
kydfru26-Jun-03 1:27
kydfru26-Jun-03 1:27 
From the MSDN:
MFC Library Reference   CFile::GetPositionSee AlsoCFile Overview | Class Members | Hierarchy ChartObtains the current value of the file pointer, which can be used in subsequent calls to Seek.virtual ULONGLONG GetPosition( ) const;Return ValueThe file pointer as a 32-bit doubleword.Example//example for CFile::GetPositionextern CFile cfile;ULONGLONG dwPosition = cfile.GetPosition();


I tried with DWORD and %u before my first post. And I tried again right now:
<br />
	char szBuf[255];<br />
	CStdioFile file("unix.file", CFile::modeRead);<br />
	file.ReadString(szBuf, 255);<br />
	DWORD dwPos = (DWORD)file.GetPosition();<br />
	TRACE("dwPos=%u\n", dwPos); // prints 2**32<br />
	file.SeekToBegin();<br />
	file.Close();<br />


As I shown before the problems come only if CStdioFile object is reading a text file with UNIX's new lines (i.e. no \r).
But such file is read actualy correct. In while(file.ReadString(szBuf, 255) loop it reads line by line not all the file context as one line.

If there is the assertion you are talking about but why it asserts only with unix text files?
Seems like a usual Micro$oft's dirty trick.

Just try to compile this little code and you'll see what I'm talkig about.
My box is Win2000 Server with VS 7.0.
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
Ryan Binns26-Jun-03 1:49
Ryan Binns26-Jun-03 1:49 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
wheregone26-Jun-03 1:52
wheregone26-Jun-03 1:52 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
kydfru26-Jun-03 2:26
kydfru26-Jun-03 2:26 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
wheregone26-Jun-03 5:27
wheregone26-Jun-03 5:27 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
kydfru26-Jun-03 7:28
kydfru26-Jun-03 7:28 
GeneralRe: I have discovered a BUG (or at least a strange behavour in CStdioFile)! Pin
wheregone26-Jun-03 14:22
wheregone26-Jun-03 14:22 
QuestionHow to determine whether a file is an executable by examining the file extension? Pin
dandy7725-Jun-03 20:28
dandy7725-Jun-03 20:28 
AnswerRe: How to determine whether a file is an executable by examining the file extension? Pin
Toni7825-Jun-03 21:56
Toni7825-Jun-03 21:56 
GeneralRe: How to determine whether a file is an executable by examining the file extension? Pin
dandy7725-Jun-03 22:20
dandy7725-Jun-03 22:20 
GeneralRe: How to determine whether a file is an executable by examining the file extension? Pin
Toni7826-Jun-03 21:23
Toni7826-Jun-03 21:23 
AnswerRe: How to determine whether a file is an executable by examining the file extension? Pin
Joaquín M López Muñoz25-Jun-03 23:14
Joaquín M López Muñoz25-Jun-03 23:14 
GeneralRasDial function Pin
no_body6925-Jun-03 19:35
no_body6925-Jun-03 19:35 
GeneralRe: RasDial function Pin
Joaquín M López Muñoz25-Jun-03 23:46
Joaquín M López Muñoz25-Jun-03 23:46 
GeneralRe: RasDial function Pin
no_body6926-Jun-03 0:31
no_body6926-Jun-03 0:31 
GeneralRe: RasDial function Pin
Joaquín M López Muñoz26-Jun-03 0:36
Joaquín M López Muñoz26-Jun-03 0:36 
GeneralRe: RasDial function Pin
no_body6927-Jun-03 22:38
no_body6927-Jun-03 22:38 
QuestionHow To Customize the CRectTracker Grippers Pin
Vikrant Vikrant25-Jun-03 19:17
Vikrant Vikrant25-Jun-03 19:17 

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.