Click here to Skip to main content
16,004,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CListCtrl, OnBegintrack Pin
Vancouver11-Oct-04 19:35
Vancouver11-Oct-04 19:35 
GeneralRe: CListCtrl, OnBegintrack Pin
Blake Miller15-Dec-04 10:09
Blake Miller15-Dec-04 10:09 
GeneralOnBegintrack, OnEndtrack Pin
Vancouver15-Dec-04 12:02
Vancouver15-Dec-04 12:02 
GeneralRe: OnBegintrack, OnEndtrack Pin
Blake Miller16-Dec-04 3:48
Blake Miller16-Dec-04 3:48 
Generalvector question... Pin
RobJones11-Oct-04 13:49
RobJones11-Oct-04 13:49 
GeneralRe: vector question... Pin
Bob Stanneveld11-Oct-04 23:44
Bob Stanneveld11-Oct-04 23:44 
GeneralRe: vector question... Pin
Jim Crafton12-Oct-04 5:25
Jim Crafton12-Oct-04 5:25 
GeneralCan't update a textbox Pin
V5Dave11-Oct-04 13:28
V5Dave11-Oct-04 13:28 
Am new to C++ and don't know if I'm doing something fundementally wrong. Have a form with a textbox and buttons. When I click on button, I am running a function in my .cpp file. However, in this function I need to update the text box in the form. Have created a public function set_address in the .h file form1 class definition that uses the following code.
public:
void Form1::set_address(char *add)
{
char temp_str[80];
sprintf(temp_str,add);
textBox1->AppendText(temp_str);
}

When I call it from my .cpp file with

Form1* pFm = new Form1;
pFm->set_address(temp_str);


It compiles OK and even runs the code, but the text box is not updated. If however I call the function from a clickbutton

private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
char temp_str[80];
sprintf(temp_str,"from button");
set_address(temp_str);
}
It happily updates the text box.

Have been pulling my hair out for 2 days, so any help would be GREATLY appreciated

Thanks

Dave C

GeneralRe: Can't update a textbox Pin
RobJones11-Oct-04 13:54
RobJones11-Oct-04 13:54 
GeneralStill Can't update a textbox Pin
V5Dave11-Oct-04 14:30
V5Dave11-Oct-04 14:30 
GeneralRe: Still Can't update a textbox Pin
RobJones11-Oct-04 17:39
RobJones11-Oct-04 17:39 
GeneralRe: Still Can't update a textbox Pin
RobJones11-Oct-04 17:50
RobJones11-Oct-04 17:50 
GeneralRe: Still Can't update a textbox Pin
V5Dave11-Oct-04 18:12
V5Dave11-Oct-04 18:12 
QuestionUsing Text Object Model for CRichEditCtrl manipulation? Pin
Jonathan Lee Brown11-Oct-04 12:39
Jonathan Lee Brown11-Oct-04 12:39 
Generalmouse events Pin
agentnem11-Oct-04 10:53
agentnem11-Oct-04 10:53 
GeneralRe: mouse events Pin
RobJones11-Oct-04 13:59
RobJones11-Oct-04 13:59 
GeneralRe: mouse events Pin
Anonymous11-Oct-04 14:08
Anonymous11-Oct-04 14:08 
GeneralRe: mouse events Pin
RobJones11-Oct-04 17:47
RobJones11-Oct-04 17:47 
GeneralRe: mouse events Pin
RobJones11-Oct-04 18:06
RobJones11-Oct-04 18:06 
Generalcant type into edit box Pin
Tim Rosser11-Oct-04 9:57
Tim Rosser11-Oct-04 9:57 
GeneralRe: cant type into edit box Pin
alex.barylski11-Oct-04 18:00
alex.barylski11-Oct-04 18:00 
GeneralSetting text in CStatic field with a pathname Pin
smbika11-Oct-04 9:50
smbika11-Oct-04 9:50 
GeneralRe: Setting text in CStatic field with a pathname Pin
David Crow11-Oct-04 10:10
David Crow11-Oct-04 10:10 
GeneralRe: Setting text in CStatic field with a pathname Pin
smbika11-Oct-04 10:40
smbika11-Oct-04 10:40 
GeneralRe: Setting text in CStatic field with a pathname Pin
David Crow11-Oct-04 10:49
David Crow11-Oct-04 10:49 

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.