GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 22-Oct-2009, 04:15
alice09 alice09 is offline
New Member
 
Join Date: Oct 2009
Posts: 6
alice09 is on a distinguished road

To get edit control value from other tabControl, in mainTabControl


Hi, all..

i'm now using Visual c++ in Visual Studio 2005 for my project. i faced problem in getting other tab value in main tab ..Below are details of my problem.
In the main tab control(CTabDialogControl), i have another sub tab namely CTabFourthDialog

inside CTabFourthDialog, have a editControl namely "IDC_EDITMCNO"
Code:
DDX_Control(pDX, IDC_EDITMCNO, m_McNo)
>> this is the edit control in CTabFourthDialog.
When i retrieved value from IDC_EDITMCNO within CTabFourthDialog, below statement can work properly:
Code:
CString sMachNo; m_McNo.GetWindowText(sMachNo);

but when i trying to retrieve the value IDC_EDITMCNO from CTabFourthDialo in CTabDialogControl , it return me a error. below shown the code i wrote in CTabDialogControl.
Code:
CString sMachNo; CTabFourthDialog::m_McNo.GetWindowText(sMachNo)

and i getting this error when compile the program.
Quote:
Error1 error C2228: left of '.GetWindowTextA' must have class/struct/union.

Please guide me to solve this problme..
Your help i will very appreciate..
Thanks very much

Regards
Alice
  #2  
Old 22-Oct-2009, 08:12
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 713
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: To get edit control value from other tabControl, in mainTabControl


CPP / C++ / C Code:
CString sMachNo;
CTabFourthDialog::m_McNo.GetWindowText(sMachNo)
This statement would imply that m_McNo is a static variable. My guess is that it is a member variable so you would access it from the object that holds it. I do not know the name of the object you are using but here is an example:
CPP / C++ / C Code:
CTabFourthDialog* pDlg = new CTabFourthDialog();
//...
pDlg->m_McNo.GetWindowText(sMachNo);
You will also need to make sure that m_McNo is a "public" variable.
  #3  
Old 23-Oct-2009, 01:39
alice09 alice09 is offline
New Member
 
Join Date: Oct 2009
Posts: 6
alice09 is on a distinguished road

Re: To get edit control value from other tabControl, in mainTabControl


Hello, thanks for reply me post..

CPP / C++ / C Code:
CTabFourthDialog* pDlg = new CTabFourthDialog();
//...
pDlg->m_McNo.GetWindowText(sMachNo);

this code still cannot function in my program..

IDD_MACHINE is my fourth dialog ID while the CTabFourthDialog is this tab class name.. and IDD_EDITMCNO is a edit control in this tab, IDD_EDITMCNO passing value to a variable called m_McNo.


erm...can u help me for more?
i will very appreciate ..
thanks you very much ^^

regards
alice ^^
  #4  
Old 23-Oct-2009, 10:38
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 713
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: To get edit control value from other tabControl, in mainTabControl


Please help me understand this. Explain in detail (with data types and names of objects) what you have and what you would like to accomplish.

For example:
Code:
I have a CDialog* object named AAA. AAA has a CTabCtrl* object named BBB. BBB has two pages of data type TTT called DDD and EEE. I would like to be able to access...
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Change Blue Color Of Selecting Text In An Edit Control smileydude46 MS Visual C++ / MFC Forum 1 29-Jan-2009 10:30
How to use an edit control and a button in a DialogBar hafida MS Visual C++ / MFC Forum 0 23-Aug-2006 03:49
How do I format a "double" number (in an edit control box) so that I can specify ... steph MS Visual C++ / MFC Forum 6 11-May-2006 12:16
[winapi] edit control is lying to me... ubergeek C Programming Language 8 15-May-2005 19:02
Help! Some basal questions about MFC xutingnjupt MS Visual C++ / MFC Forum 1 05-Dec-2004 04:38

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:11.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.