Click here to Skip to main content
15,918,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getting system font Pin
dysxq8-Apr-03 4:13
dysxq8-Apr-03 4:13 
GeneralMultiple Views in a SDI project Pin
Anonymous7-Apr-03 21:34
Anonymous7-Apr-03 21:34 
GeneralRe: Multiple Views in a SDI project Pin
Cedric Moonen7-Apr-03 21:44
Cedric Moonen7-Apr-03 21:44 
GeneralDevice units to Pixels Pin
Ernesto D.7-Apr-03 21:16
Ernesto D.7-Apr-03 21:16 
GeneralRe: Device units to Pixels Pin
Martyn Pearson7-Apr-03 21:39
Martyn Pearson7-Apr-03 21:39 
GeneralRe: Device units to Pixels Pin
puzzolino7-Apr-03 21:44
puzzolino7-Apr-03 21:44 
GeneralReplace Data in file Pin
Cedric Moonen7-Apr-03 20:36
Cedric Moonen7-Apr-03 20:36 
GeneralRe: Replace Data in file Pin
csc7-Apr-03 21:40
csc7-Apr-03 21:40 
Hi there ... hope that code snippet will help

CString csFile = "c:\\temp\\test.dat";
CFile f;
CFileException e;

TRY
{
// open the file for read/write-access
if(f.Open( csFile, CFile::shareExclusive | CFile::modeReadWrite , &e ) )
{
// read the ... bytes, where the counter is located ....
char pszLine[255] = "";
memset( pszLine, 0, sizeof( pszLine ) );
UINT nBytesRead = f.Read( pszLine, 255 );

// modify the content of the read buffer here ....
// for example : you may increment your data counter
:
:

// write modified buffer content back
f.SeekToBegin();
f.Write( pszLine, nBytesRead );

// move to the end of file and write new data
char pszNewData[1024] = "";
memset( pszNewData, 123, sizeof( pszNewData ) );
f.SeekToEnd();
f.Write( pszNewData, sizeof( pszNewData ) );

f.Close();
}
}

CATCH( CFileException, e )
{
#ifdef _DEBUG
afxDump << "File could not be opened " << e->m_cause << "\n";
#endif
}
END_CATCH
GeneralRe: Replace Data in file Pin
Martyn Pearson7-Apr-03 21:43
Martyn Pearson7-Apr-03 21:43 
GeneralRe: Replace Data in file Pin
Cedric Moonen7-Apr-03 22:07
Cedric Moonen7-Apr-03 22:07 
GeneralFile search problem Pin
RaajaOfSelf7-Apr-03 20:19
RaajaOfSelf7-Apr-03 20:19 
GeneralRe: File search problem Pin
Martyn Pearson7-Apr-03 21:46
Martyn Pearson7-Apr-03 21:46 
GeneralRe: File search problem Pin
csc7-Apr-03 21:57
csc7-Apr-03 21:57 
QuestionHow to get vector single line font as in AutoCAD???How to use it?? Pin
Jon_Hu7-Apr-03 18:49
Jon_Hu7-Apr-03 18:49 
GeneralOpenGL vs. Direct3d Pin
snood7-Apr-03 18:29
snood7-Apr-03 18:29 
GeneralRe: OpenGL vs. Direct3d Pin
puzzolino7-Apr-03 21:22
puzzolino7-Apr-03 21:22 
GeneralRe: OpenGL vs. Direct3d Pin
Roger Allen8-Apr-03 1:36
Roger Allen8-Apr-03 1:36 
General2 questions Pin
Stan the man7-Apr-03 17:11
Stan the man7-Apr-03 17:11 
GeneralRe: 2 questions Pin
Dave Bryant7-Apr-03 17:32
Dave Bryant7-Apr-03 17:32 
GeneralRe: 2 questions Pin
J. Dunlap7-Apr-03 17:36
J. Dunlap7-Apr-03 17:36 
QuestionHow do it? Pin
shd41917-Apr-03 16:38
shd41917-Apr-03 16:38 
AnswerRe: How do it? Pin
Nick Parker7-Apr-03 16:46
protectorNick Parker7-Apr-03 16:46 
GeneralThank you. I have solved it. Pin
shd41917-Apr-03 16:56
shd41917-Apr-03 16:56 
GeneralTask Bar confusion! Help Pin
brigham_young7-Apr-03 15:16
brigham_young7-Apr-03 15:16 
GeneralRe: Task Bar confusion! Help Pin
Nick Parker7-Apr-03 16:34
protectorNick Parker7-Apr-03 16:34 

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.