Click here to Skip to main content
15,920,708 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: tetris source file. Pin
Rajesh R Subramanian27-Oct-08 19:58
professionalRajesh R Subramanian27-Oct-08 19:58 
QuestionRe: tetris source file. Pin
David Crow27-Oct-08 3:28
David Crow27-Oct-08 3:28 
AnswerRe: tetris source file. Pin
bolivar12328-Oct-08 2:42
bolivar12328-Oct-08 2:42 
QuestionSCI_GETTEXT - Scintilla, how do I get the text ? Pin
gabbana26-Oct-08 5:37
gabbana26-Oct-08 5:37 
QuestionRe: SCI_GETTEXT - Scintilla, how do I get the text ? [modified] Pin
CPallini26-Oct-08 7:50
mveCPallini26-Oct-08 7:50 
AnswerRe: SCI_GETTEXT - Scintilla, how do I get the text ? Pin
gabbana26-Oct-08 8:25
gabbana26-Oct-08 8:25 
GeneralRe: SCI_GETTEXT - Scintilla, how do I get the text ? Pin
CPallini26-Oct-08 8:45
mveCPallini26-Oct-08 8:45 
GeneralRe: SCI_GETTEXT - Scintilla, how do I get the text ? Pin
gabbana26-Oct-08 17:03
gabbana26-Oct-08 17:03 
Okay, but without luck.

Iam not sure what the error exactly is, but if I have a breakpoint at the last SendMessage and look in the Debugger &data have a value of 0x00... and Bad Ptr

And the MessageBox is empty.

The code looks like this:

UINT length = SendMessage(hWndEditor, SCI_GETLENGTH, 0, 0);
TCHAR *data;
memset(&data, 0, sizeof(TCHAR)*length+1);
length = SendMessage(hWndEditor, SCI_GETTEXT,length+1,(LPARAM)data);
MessageBox(NULL,data,L"Test",0);
free(data);


At the end of the function I also get this error:

Stack around the variable 'data' was corrupted

modified on Sunday, October 26, 2008 11:16 PM

GeneralRe: SCI_GETTEXT - Scintilla, how do I get the text ? Pin
SandipG 26-Oct-08 20:58
SandipG 26-Oct-08 20:58 
GeneralRe: SCI_GETTEXT - Scintilla, how do I get the text ? Pin
gabbana26-Oct-08 22:29
gabbana26-Oct-08 22:29 
GeneralRe: SCI_GETTEXT - Scintilla, how do I get the text ? [modified] Pin
SandipG 26-Oct-08 22:35
SandipG 26-Oct-08 22:35 
GeneralRe: SCI_GETTEXT - Scintilla, how do I get the text ? Pin
gabbana26-Oct-08 23:01
gabbana26-Oct-08 23:01 
GeneralRe: SCI_GETTEXT - Scintilla, how do I get the text ? Pin
gabbana27-Oct-08 20:28
gabbana27-Oct-08 20:28 
GeneralRe: SCI_GETTEXT - Scintilla, how do I get the text ? Pin
Larry Mills Sr30-Oct-08 7:48
Larry Mills Sr30-Oct-08 7:48 
QuestionHeader File: stdint.h Pin
bigdenny20026-Oct-08 3:44
bigdenny20026-Oct-08 3:44 
Questiondistinguish between physical drive and logical drive ? Pin
devider26-Oct-08 3:29
devider26-Oct-08 3:29 
QuestionMoveFile: Access denied ??? Pin
gabbana26-Oct-08 1:44
gabbana26-Oct-08 1:44 
AnswerRe: MoveFile: Access denied ??? Pin
Perspx26-Oct-08 1:51
Perspx26-Oct-08 1:51 
GeneralRe: MoveFile: Access denied ??? Pin
gabbana26-Oct-08 2:33
gabbana26-Oct-08 2:33 
GeneralRe: MoveFile: Access denied ??? Pin
Larry Mills Sr30-Oct-08 7:57
Larry Mills Sr30-Oct-08 7:57 
QuestionConvert Strings Pin
akshay.is.gr825-Oct-08 23:12
akshay.is.gr825-Oct-08 23:12 
AnswerRe: Convert Strings Pin
Nibu babu thomas25-Oct-08 23:50
Nibu babu thomas25-Oct-08 23:50 
AnswerRe: Convert Strings Pin
Cedric Moonen26-Oct-08 0:20
Cedric Moonen26-Oct-08 0:20 
GeneralRe: Convert Strings Pin
Iain Clarke, Warrior Programmer26-Oct-08 3:15
Iain Clarke, Warrior Programmer26-Oct-08 3:15 
GeneralRe: Convert Strings Pin
Cedric Moonen26-Oct-08 4:52
Cedric Moonen26-Oct-08 4:52 

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.