Click here to Skip to main content
15,909,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Basic array problem Pin
Cool_Dev19-Apr-11 21:24
Cool_Dev19-Apr-11 21:24 
AnswerRe: Basic array problem Pin
Niklas L19-Apr-11 22:15
Niklas L19-Apr-11 22:15 
Questioni having problem to connect my MFC form to Access database using sql query.. Pin
tohard19-Apr-11 14:51
tohard19-Apr-11 14:51 
AnswerRe: i having problem to connect my MFC form to Access database using sql query.. Pin
Rajesh R Subramanian19-Apr-11 20:23
professionalRajesh R Subramanian19-Apr-11 20:23 
QuestionShared Library o DLL? Pin
Andy20219-Apr-11 6:36
Andy20219-Apr-11 6:36 
AnswerRe: Shared Library o DLL? Pin
Albert Holguin19-Apr-11 7:30
professionalAlbert Holguin19-Apr-11 7:30 
QuestionDeskband (XP) Problem.. Pin
nitin319-Apr-11 5:54
nitin319-Apr-11 5:54 
QuestionProblems with getting data from a Edit Control [modified] Pin
jhoesche19-Apr-11 4:54
jhoesche19-Apr-11 4:54 
I am trying to call a function in one class from another class and when I do,
I can not get or set data that is in any of the Edit Controls in my dialog
of the function that I am calling.

I have multiple columns of simuliar controls that I want to copy from one to the others.
So I call my copy function and try to copy from one column to the selected others. Slider Controls,
Check boxes, and Radio Buttons seem to work fine, but I can not get the Edit contols to work.

Here is an example of the code I have:

// Dialog1 Class
class Dialog1 : public CDialog
{
public:
	void CallCopyFnc();
private:
	Dialog2* myDlg2;
}


// Dialog2 Class that has Child property set
class Dialog2 : public CDialog
{
public:
	void CopyDataFnc();
}


// In Dialog1 cpp file
Dialog1::OnInitData()
{
	myDlg2 = new Dialog2;
}

Dialog1::CalllCopyFnc()
{
	myDlg2->CopyDataFnc();
}


// In Dialog2 cpp file
Dialog2::CopyDataFnc()
{
	CString str;

	str.Format("0x%08X", number);
	EditCtrl.SetDlgItemTextA(idEditCtrl, str);
	// This does nothing to the Edit control and I can not read the 
	// text in it either if I use GetDlgItemText()
	// If I use Get or SetDlgItemText(idEditctrl, str); then I get an unhandled exception - 
}


Any help would be appreciated as to what I am doing wrong. Thanks in advance!

David

modified on Tuesday, April 19, 2011 12:33 PM

AnswerRe: Problems with getting data from a Edit Control Pin
David Crow19-Apr-11 7:13
David Crow19-Apr-11 7:13 
GeneralRe: Problems with getting data from a Edit Control Pin
jhoesche19-Apr-11 8:49
jhoesche19-Apr-11 8:49 
AnswerRe: Problems with getting data from a Edit Control Pin
Hans Dietrich19-Apr-11 11:37
mentorHans Dietrich19-Apr-11 11:37 
GeneralRe: Problems with getting data from a Edit Control Pin
jhoesche19-Apr-11 12:12
jhoesche19-Apr-11 12:12 
GeneralRe: Problems with getting data from a Edit Control [modified] Pin
David Crow20-Apr-11 3:47
David Crow20-Apr-11 3:47 
GeneralRe: Problems with getting data from a Edit Control Pin
jhoesche20-Apr-11 5:56
jhoesche20-Apr-11 5:56 
GeneralRe: Problems with getting data from a Edit Control Pin
David Crow20-Apr-11 6:54
David Crow20-Apr-11 6:54 
GeneralRe: Problems with getting data from a Edit Control Pin
jhoesche20-Apr-11 7:16
jhoesche20-Apr-11 7:16 
GeneralRe: Problems with getting data from a Edit Control Pin
David Crow20-Apr-11 7:26
David Crow20-Apr-11 7:26 
GeneralRe: Problems with getting data from a Edit Control Pin
jhoesche20-Apr-11 10:12
jhoesche20-Apr-11 10:12 
GeneralRe: Problems with getting data from a Edit Control Pin
David Crow20-Apr-11 10:41
David Crow20-Apr-11 10:41 
Questionhow to initialize a variable whose name is passed as a string with a given value in a function in vc++6.0 Pin
manoharbalu19-Apr-11 2:36
manoharbalu19-Apr-11 2:36 
AnswerRe: how to initialize a variable whose name is passed as a string with a given value in a function in vc++6.0 Pin
Chris Losinger19-Apr-11 2:48
professionalChris Losinger19-Apr-11 2:48 
GeneralRe: how to initialize a variable whose name is passed as a string with a given value in a function in vc++6.0 Pin
manoharbalu19-Apr-11 3:12
manoharbalu19-Apr-11 3:12 
GeneralRe: how to initialize a variable whose name is passed as a string with a given value in a function in vc++6.0 Pin
Chris Losinger19-Apr-11 3:28
professionalChris Losinger19-Apr-11 3:28 
AnswerRe: how to initialize a variable whose name is passed as a string with a given value in a function in vc++6.0 Pin
Hans Dietrich19-Apr-11 3:29
mentorHans Dietrich19-Apr-11 3:29 
AnswerRe: how to initialize a variable whose name is passed as a string with a given value in a function in vc++6.0 Pin
_AnsHUMAN_ 19-Apr-11 2:50
_AnsHUMAN_ 19-Apr-11 2:50 

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.