Click here to Skip to main content
15,902,840 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: An Ado problem ,help Pin
tyr20002-Nov-09 17:26
tyr20002-Nov-09 17:26 
GeneralRe: An Ado problem ,help Pin
Adam Roderick J2-Nov-09 19:52
Adam Roderick J2-Nov-09 19:52 
GeneralRe: An Ado problem ,help Pin
tyr20002-Nov-09 20:05
tyr20002-Nov-09 20:05 
GeneralRe: An Ado problem ,help Pin
Adam Roderick J2-Nov-09 21:57
Adam Roderick J2-Nov-09 21:57 
QuestionRe: An Ado problem ,help Pin
David Crow3-Nov-09 2:50
David Crow3-Nov-09 2:50 
RantRe: An Ado problem ,help [modified] Pin
Adam Roderick J5-Nov-09 21:47
Adam Roderick J5-Nov-09 21:47 
GeneralRe: An Ado problem ,help Pin
David Crow3-Nov-09 2:52
David Crow3-Nov-09 2:52 
QuestionReading Text From Single Line CEdit Pin
Judgement28 2-Nov-09 14:32
Judgement28 2-Nov-09 14:32 
I wrote the below function to read the contents of a single line CEdit control when the enter key is pressed.

void CCommandBox::ProcessEnterKey()
{   
    int dLineLen = LineLength();
    char* szCommand = new char[dLineLen()+1];
    GetLine(0, szCommand);
    szCommand[dLineLen] = '\0';

    E.m_pcpCmdParser->ProcessCommand(szCommand, false);
    SetWindowText("");
    delete[] szCommand;
}

It works perfectly when running in debug mode but when I build a release version szCommand just gets filled with junk. I had this exact same problem last time I tried to do something similar and in end I had to switch to a CRichEdit and use StreamOut() but I'd rather not do that again.

What's the correct way to read a line from a CEdit control so that it works in a release build?
AnswerRe: Reading Text From Single Line CEdit Pin
«_Superman_»2-Nov-09 15:53
professional«_Superman_»2-Nov-09 15:53 
GeneralRe: Reading Text From Single Line CEdit Pin
Judgement28 2-Nov-09 18:35
Judgement28 2-Nov-09 18:35 
QuestionRe: Reading Text From Single Line CEdit Pin
KarstenK2-Nov-09 21:24
mveKarstenK2-Nov-09 21:24 
QuestionC++ socket connection send problem Pin
sugarandcream2-Nov-09 13:11
sugarandcream2-Nov-09 13:11 
AnswerRe: C++ socket connection send problem Pin
«_Superman_»2-Nov-09 14:14
professional«_Superman_»2-Nov-09 14:14 
GeneralRe: C++ socket connection send problem Pin
sugarandcream2-Nov-09 14:31
sugarandcream2-Nov-09 14:31 
GeneralRe: C++ socket connection send problem Pin
«_Superman_»2-Nov-09 15:50
professional«_Superman_»2-Nov-09 15:50 
GeneralRe: C++ socket connection send problem Pin
Moak2-Nov-09 23:44
Moak2-Nov-09 23:44 
QuestionXCrashReport : Exception Handling and system calls Pin
aputic2-Nov-09 12:34
aputic2-Nov-09 12:34 
GeneralRe: XCrashReport : Exception Handling and system calls Pin
Moak3-Nov-09 7:25
Moak3-Nov-09 7:25 
GeneralRe: XCrashReport : Exception Handling and system calls Pin
aputic5-Nov-09 0:01
aputic5-Nov-09 0:01 
GeneralRe: XCrashReport : Exception Handling and system calls Pin
Moak5-Nov-09 0:53
Moak5-Nov-09 0:53 
QuestionC++ to MySQL Connections Pin
santhosh-padamatinti2-Nov-09 7:22
santhosh-padamatinti2-Nov-09 7:22 
AnswerRe: C++ to MySQL Connections Pin
loyal ginger2-Nov-09 10:37
loyal ginger2-Nov-09 10:37 
AnswerRe: C++ to MySQL Connections Pin
Saurabh.Garg2-Nov-09 14:57
Saurabh.Garg2-Nov-09 14:57 
QuestionSetSelection in CSliderCtrl not working in XP. Pin
iwt.dev2-Nov-09 6:08
iwt.dev2-Nov-09 6:08 
QuestionRe: SetSelection in CSliderCtrl not working in XP. Pin
David Crow2-Nov-09 6:30
David Crow2-Nov-09 6:30 

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.