Click here to Skip to main content
16,011,784 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalthe copy cursor Pin
Steve L.16-Jul-02 13:45
Steve L.16-Jul-02 13:45 
GeneralRe: the copy cursor Pin
Shog916-Jul-02 14:04
sitebuilderShog916-Jul-02 14:04 
GeneralDialog DLL and Timers Pin
Wade H.16-Jul-02 12:34
Wade H.16-Jul-02 12:34 
GeneralRe: Dialog DLL and Timers Pin
[James Pullicino]17-Jul-02 4:59
[James Pullicino]17-Jul-02 4:59 
GeneralRe: Dialog DLL and Timers Pin
Wade H.17-Jul-02 6:32
Wade H.17-Jul-02 6:32 
GeneralError Damage after normal block 63 at .... Pin
Anonymous16-Jul-02 12:08
Anonymous16-Jul-02 12:08 
GeneralRe: Error Damage after normal block 63 at .... Pin
Joaquín M López Muñoz16-Jul-02 12:19
Joaquín M López Muñoz16-Jul-02 12:19 
GeneralRe: Error Damage after normal block 63 at .... Pin
Shog916-Jul-02 12:25
sitebuilderShog916-Jul-02 12:25 
I didn't finish reading the code, but here's the first problem at least:
m_pFileData = new BYTE[m_nMsgLength];
 
// Fills the m_pFileData with the String
m_pFileData = (BYTE*) (LPCTSTR) m_strMessage.LockBuffer();


Allocates a buffer, and immediately looses the only pointer to it. Then, at the end:
m_strMessage.UnlockBuffer();
 
// Displays the String after being encrypted
m_strMessage = (LPCTSTR) m_pFileData;


Unlocking the buffer tells CString that you're no longer holding any pointers to its internal data (which you in fact are), and that it can go ahead and free it if it needs to. Think for a bit about what's going to happen when it frees that internal buffer, and then tries to copy into a new buffer whatever happens to be in the memory where the old buffer once was...

Like i said, i didn't read through the rest of the code, (could you indent pls?) but this is definately a place to start... Smile | :)

--------

PMGRE

--Shog9 --


GeneralRe: Error Damage after normal block 63 at .... Pin
Anonymous16-Jul-02 12:49
Anonymous16-Jul-02 12:49 
GeneralDoBulkFieldExchange problem Pin
achandra00716-Jul-02 12:07
achandra00716-Jul-02 12:07 
GeneralOne column in list control Pin
ns16-Jul-02 11:46
ns16-Jul-02 11:46 
GeneralRe: I got it. Thanks anyways Pin
ns16-Jul-02 11:50
ns16-Jul-02 11:50 
GeneralRe: I got it. Thanks anyways Pin
kati4214-Nov-02 19:33
kati4214-Nov-02 19:33 
QuestionHow to read a file that is open by ... Pin
craigk16-Jul-02 11:25
craigk16-Jul-02 11:25 
GeneralDAO in VC++ not working. Pin
a3gupta16-Jul-02 11:15
a3gupta16-Jul-02 11:15 
GeneralRe: DAO in VC++ not working. Pin
Martin Ziacek16-Jul-02 19:36
Martin Ziacek16-Jul-02 19:36 
GeneralRe: DAO in VC++ not working. Pin
a3gupta16-Jul-02 20:36
a3gupta16-Jul-02 20:36 
GeneralRe: DAO in VC++ not working. Pin
Martin Ziacek16-Jul-02 22:33
Martin Ziacek16-Jul-02 22:33 
GeneralRe: DAO in VC++ not working. Pin
Schnemar16-Jul-02 22:35
Schnemar16-Jul-02 22:35 
GeneralModeless Dialog Pin
udayGovekar16-Jul-02 10:29
udayGovekar16-Jul-02 10:29 
GeneralRe: Modeless Dialog Pin
includeh1016-Jul-02 10:56
includeh1016-Jul-02 10:56 
GeneralRe: Modeless Dialog Pin
udayGovekar16-Jul-02 18:38
udayGovekar16-Jul-02 18:38 
Generaladding a new configuration Pin
NickOne16-Jul-02 10:27
NickOne16-Jul-02 10:27 
GeneralRe: adding a new configuration Pin
Joaquín M López Muñoz16-Jul-02 12:00
Joaquín M López Muñoz16-Jul-02 12:00 
GeneralRe: adding a new configuration Pin
NickOne17-Jul-02 8:10
NickOne17-Jul-02 8:10 

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.