Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get size of dynamic array Pin
geo_m26-Jan-05 1:29
geo_m26-Jan-05 1:29 
GeneralRe: How to get size of dynamic array Pin
David Crow26-Jan-05 3:08
David Crow26-Jan-05 3:08 
GeneralConvert CString Pin
RedDragon2k25-Jan-05 8:48
RedDragon2k25-Jan-05 8:48 
GeneralRe: Convert CString Pin
toxcct25-Jan-05 9:52
toxcct25-Jan-05 9:52 
GeneralRe: Convert CString Pin
Bob Ciora25-Jan-05 12:26
Bob Ciora25-Jan-05 12:26 
GeneralRe: Convert CString Pin
RedDragon2k26-Jan-05 5:29
RedDragon2k26-Jan-05 5:29 
GeneralRe: Convert CString Pin
digwizfox13-Apr-05 7:08
digwizfox13-Apr-05 7:08 
GeneralOutputting to MFC Dialog Box Pin
CNewbie25-Jan-05 8:35
CNewbie25-Jan-05 8:35 
Question. I have been doing c++ code for sometime now but only in console code. I am starting now to use MFC and I wanted to convert my old Console code into GUI MFC code. My Code relies heavily on Stream I/O with strings and character arrays, but I am having a problem getting my character arrays to output to my GUI correctly. I keep getting assertion errors when when running the program (NOTE: the program compiles error free).

Here is an example of what works:

void CParserDlg::OnParse()
{
char key[16]; //Make Array "Key"
strcpy(key, "Text Here"); //Copy "Text Here" into array
UpdateData(TRUE); //
m_strkey.Format(key); //Send String to Dialog Box
UpdateData(FALSE); //
}

This works fine and outputs the string "Text Here" to the dialog box. Now if I try and output 1 character and not the whole thing I get an assertion error:

void CParserDlg::OnParse()
{
char key[16]; //Make Array "Key"
strcpy(key, "Text Here"); //Copy "Text Here" into array
UpdateData(TRUE); //
m_strkey.Format(key[2]); //<------- Send String to Dialog Box
UpdateData(FALSE); //
}

Notice key[2] instead of just key. Not sure why it will not let me just output 1 character.

Thanks
GeneralRe: Outputting to MFC Dialog Box Pin
Wes Aday25-Jan-05 9:34
professionalWes Aday25-Jan-05 9:34 
GeneralRe: Outputting to MFC Dialog Box Pin
Bob Ciora25-Jan-05 11:02
Bob Ciora25-Jan-05 11:02 
GeneralRe: Outputting to MFC Dialog Box Pin
toxcct25-Jan-05 9:57
toxcct25-Jan-05 9:57 
GeneralRe: Outputting to MFC Dialog Box Pin
CNewbie25-Jan-05 13:06
CNewbie25-Jan-05 13:06 
GeneralRe: Outputting to MFC Dialog Box Pin
CNewbie25-Jan-05 14:10
CNewbie25-Jan-05 14:10 
GeneralRe: Outputting to MFC Dialog Box Pin
FlyingTinman25-Jan-05 14:54
FlyingTinman25-Jan-05 14:54 
GeneralRe: Outputting to MFC Dialog Box Pin
CNewbie25-Jan-05 15:45
CNewbie25-Jan-05 15:45 
GeneralRe: Outputting to MFC Dialog Box Pin
David Crow26-Jan-05 3:21
David Crow26-Jan-05 3:21 
GeneralRe: Outputting to MFC Dialog Box Pin
CNewbie26-Jan-05 16:24
CNewbie26-Jan-05 16:24 
GeneralSetup Project Pin
Galen_225-Jan-05 5:42
Galen_225-Jan-05 5:42 
GeneralRe: Setup Project Pin
rwestgraham25-Jan-05 23:24
rwestgraham25-Jan-05 23:24 
GeneralMFC and web-site Pin
includeh1025-Jan-05 5:14
includeh1025-Jan-05 5:14 
GeneralRe: MFC and web-site Pin
Tom Wright25-Jan-05 5:37
Tom Wright25-Jan-05 5:37 
GeneralSave/Restore appearance scheme Pin
Member 166110225-Jan-05 4:49
Member 166110225-Jan-05 4:49 
GeneralRe: Save/Restore appearance scheme Pin
David Crow26-Jan-05 3:43
David Crow26-Jan-05 3:43 
Questioninf file??? Pin
charleslau285525-Jan-05 4:40
charleslau285525-Jan-05 4:40 
GeneralDrawDragRect Pin
poiut25-Jan-05 4:17
poiut25-Jan-05 4:17 

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.