Click here to Skip to main content
15,891,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCrash in CAsyncSocket::Close() Pin
Anorexic Tribble19-Oct-07 2:19
Anorexic Tribble19-Oct-07 2:19 
AnswerRe: Crash in CAsyncSocket::Close() Pin
led mike19-Oct-07 4:15
led mike19-Oct-07 4:15 
GeneralRe: Crash in CAsyncSocket::Close() Pin
Anorexic Tribble19-Oct-07 4:37
Anorexic Tribble19-Oct-07 4:37 
GeneralRe: Crash in CAsyncSocket::Close() Pin
led mike19-Oct-07 5:24
led mike19-Oct-07 5:24 
QuestionCopying from unsigned char * to the CString Pin
ashishbhatt19-Oct-07 2:01
ashishbhatt19-Oct-07 2:01 
AnswerRe: Copying from unsigned char * to the CString Pin
john563219-Oct-07 2:11
john563219-Oct-07 2:11 
GeneralRe: Copying from unsigned char * to the CString Pin
ashishbhatt19-Oct-07 2:23
ashishbhatt19-Oct-07 2:23 
GeneralRe: Copying from unsigned char * to the CString Pin
Tydia-kun19-Oct-07 3:50
Tydia-kun19-Oct-07 3:50 
Does not surprise me that it gives you an access violation when doing that.
The first and foremost rule to remember is: DO NOT USE MEMCPY ON CLASSES.
Classes work independently, managing their own memory and so on. Therefore, you should use the exposed interfaces in the classes to do stuff.
In this case, you're overwriting important data in the class, not to mention that the class's internal buffer is nowhere large enough to hold your data.
As mentioned, use CString.GetBuffer(LengthOfBuffer). It returns a pointer to a buffer. Copy data using memcpy/CopyMemory. Then call CString.ReleaseBuffer(LengthOfData).
That should do the trick.
AnswerRe: Copying from unsigned char * to the CString Pin
Nishad S19-Oct-07 2:13
Nishad S19-Oct-07 2:13 
AnswerRe: Copying from unsigned char * to the CString Pin
James R. Twine19-Oct-07 7:13
James R. Twine19-Oct-07 7:13 
Questionhow to draw a dynamic curve Pin
nibabug19-Oct-07 0:31
nibabug19-Oct-07 0:31 
AnswerRe: how to draw a dynamic curve Pin
jhwurmbach19-Oct-07 0:45
jhwurmbach19-Oct-07 0:45 
GeneralRe: how to draw a dynamic curve Pin
nibabug19-Oct-07 0:51
nibabug19-Oct-07 0:51 
GeneralRe: how to draw a dynamic curve Pin
jhwurmbach19-Oct-07 0:56
jhwurmbach19-Oct-07 0:56 
AnswerRe: how to draw a dynamic curve Pin
chandu00419-Oct-07 0:48
chandu00419-Oct-07 0:48 
GeneralRe: how to draw a dynamic curve Pin
Hamid_RT19-Oct-07 0:57
Hamid_RT19-Oct-07 0:57 
GeneralRe: how to draw a dynamic curve Pin
chandu00419-Oct-07 1:06
chandu00419-Oct-07 1:06 
GeneralRe: how to draw a dynamic curve Pin
Cedric Moonen19-Oct-07 1:11
Cedric Moonen19-Oct-07 1:11 
GeneralRe: how to draw a dynamic curve Pin
chandu00419-Oct-07 1:22
chandu00419-Oct-07 1:22 
GeneralRe: how to draw a dynamic curve Pin
Cedric Moonen19-Oct-07 1:24
Cedric Moonen19-Oct-07 1:24 
GeneralRe: how to draw a dynamic curve Pin
chandu00419-Oct-07 1:36
chandu00419-Oct-07 1:36 
GeneralRe: how to draw a dynamic curve Pin
nibabug19-Oct-07 0:59
nibabug19-Oct-07 0:59 
GeneralRe: how to draw a dynamic curve Pin
chandu00419-Oct-07 1:10
chandu00419-Oct-07 1:10 
AnswerRe: how to draw a dynamic curve Pin
Hamid_RT19-Oct-07 0:56
Hamid_RT19-Oct-07 0:56 
AnswerRe: how to draw a dynamic curve Pin
Nishad S19-Oct-07 1:21
Nishad S19-Oct-07 1:21 

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.