Click here to Skip to main content
16,004,761 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Closing a program Launched with ShellExecute Pin
Dennis Little1-Jun-00 10:08
sussDennis Little1-Jun-00 10:08 
GeneralDialog On Top Pin
Member 434829-May-00 7:02
Member 434829-May-00 7:02 
GeneralRe: Dialog On Top Pin
Mike Dunn29-May-00 18:38
Mike Dunn29-May-00 18:38 
QuestionHow To : center a CFormView in a SDI app ??? Pin
Luc Bergeron29-May-00 6:57
Luc Bergeron29-May-00 6:57 
AnswerRe: How To : center a CFormView in a SDI app ??? Pin
Cristi Posea30-May-00 21:02
Cristi Posea30-May-00 21:02 
AnswerRe: How To : center a CFormView in a SDI app ??? Pin
Kurt2-Jun-00 2:38
Kurt2-Jun-00 2:38 
GeneralRe: How To : center a CFormView in a SDI app ??? Pin
Member 7505-Jun-00 18:18
Member 7505-Jun-00 18:18 
GeneralEncrypt/Decrypting Files (CR & LF chars not correct in .exes) Pin
daniel madden28-May-00 23:34
daniel madden28-May-00 23:34 
Hi folks,

I am writting a program that Encrypts/Decrypts files (using CFile). It works fine when I do Text files, but when I do an .exe (Decrypting), it puts a different char?? could this have to do with the way I'm reading in the File (mode)?

I have tried using it in Binary Mode and still the same!

NOTE: All of the characters (placement) are correct, its just that in the .exe there is NOT all of the little rectangular chars...its empty (visually) space (see below).

===========================================================
MZÿÿ¸@躴 Í!¸LÍ!This program cannot be run in DOS mode.
===========================================================

Here is some code:

// Open the file to be read
if( cfEnFile.Open( LPCTSTR(csFileName), CFile::modeReadWrite | CFile::typeBinary, &e ) ) {

// Get the length of the file
DWORD dwSize = cfEnFile.GetLength();

cfEnFile.SeekToBegin();

// fill the buffer with the information from file
UINT nBytesRead = cfEnFile.Read( szBufRead, (UINT)dwSize); //(UINT) dwSize );

...
...
...

for (int n=0; n<(int)nBytesRead; n++) {
CString csEnByte = szBufRead[n];
m_AESCrypt.TransformString(csRegUPPRead, csEnByte);
csBufBytes += csEnByte;
}

sprintf(szBufWrite, "%s", csBufBytes);

cfEnFile.SeekToBegin();

// Write the buffer to the file
cfEnFile.Write( szBufWrite, (UINT)dwSize);

}

Is there anyone who can help!!!!!

Thanks in advance!

Dan
GeneralRe: Encrypt/Decrypting Files (CR & LF chars not correct in .exes) Pin
Chris Meech29-May-00 3:35
Chris Meech29-May-00 3:35 
GeneralRe: Encrypt/Decrypting Files (CR & LF chars not correct in .exes) Pin
Member 7505-Jun-00 18:22
Member 7505-Jun-00 18:22 
GeneralADO. Could not update recordset Pin
bbw28-May-00 17:13
bbw28-May-00 17:13 
QuestionHow can I print an adobe pdf as a boilerplate? Pin
Erich J. Ruth28-May-00 9:55
sussErich J. Ruth28-May-00 9:55 
AnswerRe: How can I print an adobe pdf as a boilerplate? Pin
Mike Dunn28-May-00 16:43
Mike Dunn28-May-00 16:43 
GeneralRe: How can I print an adobe pdf as a boilerplate? Pin
Erich J. Ruth29-May-00 11:52
sussErich J. Ruth29-May-00 11:52 
GeneralRe: How can I print an adobe pdf as a boilerplate? Pin
Mike Dunn29-May-00 18:29
Mike Dunn29-May-00 18:29 
AnswerRe: How can I print an adobe pdf as a boilerplate? Pin
Member 120896530-May-00 14:08
Member 120896530-May-00 14:08 
AnswerRe: How can I print an adobe pdf as a boilerplate? Pin
Cristi Posea30-May-00 21:34
Cristi Posea30-May-00 21:34 
GeneralRegistry Class - Writes to both Windows 95 and Windows 98 Pin
Bob Eastman28-May-00 9:48
Bob Eastman28-May-00 9:48 
GeneralRe: Registry Class - Writes to both Windows 95 and Windows 98 Pin
Mike Dunn28-May-00 16:45
Mike Dunn28-May-00 16:45 
QuestionHow to set a individual row-picture (Bitmap) in ClistCtrl ? Pin
Sascha28-May-00 7:43
Sascha28-May-00 7:43 
AnswerRe: How to set a individual row-picture (Bitmap) in ClistCtrl ? Pin
Dmitriy29-May-00 5:22
Dmitriy29-May-00 5:22 
AnswerRe: How to set a individual row-picture (Bitmap) in ClistCtrl ? Pin
Paolo Messina30-May-00 11:03
professionalPaolo Messina30-May-00 11:03 
GeneralMenu in the menu bar Pin
Member 403228-May-00 5:41
Member 403228-May-00 5:41 
GeneralRe: Menu in the menu bar Pin
Brian Hart25-Jun-00 13:23
Brian Hart25-Jun-00 13:23 
GeneralInteger operations Pin
Andreas Jäger27-May-00 22:19
Andreas Jäger27-May-00 22:19 

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.