Click here to Skip to main content
15,921,542 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
for data file "00000000h: 31 31 31 31 31 31 3D 0A ..."
my function returns "111111="
for the second time, it returns "", I think I should increase g_fPosition.
But the GetPosition is OK anyway.

/////////////////////////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////////////////////////
char gchOneLineNews[1024];
FILETIME g_ftWrite = { 0, 0 };
ULONGLONG g_fPosition = 0;
char * GetOneLineNews(char * pFile);
/////////////////////////////////////////////////////////////////////////////////////////////
// Get One Line News from the File, (read next line, check the write time)
/////////////////////////////////////////////////////////////////////////////////////////////
char * GetOneLineNews(char * pFile)
{
#if 1
FILETIME ftWrite;
UINT rt = 0;


CStdioFile file;
CFileException ex;

if (file.Open(pFile, CFile::modeRead, &ex))
{
if (GetFileTime(file, NULL, NULL, &ftWrite))
{
if(0 != CompareFileTime( &ftWrite, &g_ftWrite )) // not same
{
g_fPosition = 0;
g_ftWrite.dwLowDateTime = ftWrite.dwLowDateTime;
g_ftWrite.dwHighDateTime = ftWrite.dwHighDateTime;
}

file.Seek( g_fPosition, CFile::begin );
if ( NULL == file.ReadString( gchOneLineNews, 1023 ))
{
g_fPosition = 0;
file.Seek( g_fPosition, CFile::begin );
file.ReadString( gchOneLineNews, 1023 );
}

g_fPosition = file.GetPosition();
}
else
{
rt = -2;
}

file.Close();
}
else
{
rt = -1;
}
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 
AnswerRe: How To Customize the CRectTracker Grippers Pin
Rob Caldecott25-Jun-03 22:13
Rob Caldecott25-Jun-03 22:13 
GeneralRe: How To Customize the CRectTracker Grippers Pin
Vikrant Vikrant25-Jun-03 23:14
Vikrant Vikrant25-Jun-03 23:14 
GeneralRe: How To Customize the CRectTracker Grippers Pin
Rob Caldecott25-Jun-03 23:34
Rob Caldecott25-Jun-03 23:34 
GeneralRe: How To Customize the CRectTracker Grippers Pin
Vikrant Vikrant26-Jun-03 0:46
Vikrant Vikrant26-Jun-03 0:46 
QuestionConverting Char* hex to Integer..? Pin
Member 40481325-Jun-03 19:00
Member 40481325-Jun-03 19:00 
AnswerRe: Converting Char* hex to Integer..? Pin
Ravi Bhavnani25-Jun-03 19:11
professionalRavi Bhavnani25-Jun-03 19:11 

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.