|
Hi,
I have created a modal dialogbox and attached a button and named it as Save.
Whenever I clicked on it I want to display another dialogbox with a combo box attached to it.Whenever I clicked on OK button I need to get the data in the first Dialog box.
void CDialogClass1:OnSave()
{
CDialog2 dlg2;
dlg2.DoModal();//I attached a combo box to it.
}
Please can u help me.
Thanks in advance.
|
|
|
|
|
U can pass parameter from First Dialog to second dialg
1 ) through constructor
2) Via member variable
( CDialog2 dlg2;
dlg2.m_Var = m_Var_one
dlg2.DoModal();//I attached a combo box to it.
3) Keep a global variable and share value in two dialog
|
|
|
|
|
I am very sorry.I can't understand what u said.
I need not want to send data from first dialogbox to the second dialogbox which contains the combobox.
I want from the data from second dialog's combobox.
Thanks for u r effort.
|
|
|
|
|
IF you want the data from the second dialog box in the first one:
you can do this:
if(dlg2.DoModal()==IDOK)
{
dlg2.m_myCombo.// Some function to retrieve data from combo box
}
-- modified at 9:03 Tuesday 26th September, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: dlg2.m_myCombo.// Some function to retrieve data from combo box
Not possible, as the combobox no longer exists.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
vc++_fragrance wrote: display another dialogbox with a combo box attached to it.Whenever I clicked on OK button I need to get the data in the first Dialog box.
There are two ways to this in my knowledge:
1) If it's a base/derived relationship you can use GetParent() to get a pointer of the parent class in the derived class and then use it to access the member functions of the parent class and also the member variables depending on their access modifiers.
2) You can create a pointer of the first class(From where you are calling DoModal()) into the second class where you need the contents of the first dialog.
For this:
a) Include the header file of the first dialog in the second.
b) In the public section declare a pointer of the first class.
Like: CMyFirstClass *pFirstClass;
c) Just above the line dlg2.DoModal() you can write dlg2.pFirstClass=this;
d) Now you can access the variables/members/member functions of the first dialog in the second dialog using pFirstClass.
Like: pFirstClass->m_strEdit.GetWindowText(...);
etc....
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
if your main class is CMainDlg you can use CMainDlg* m_Main=(CMainDlg*)GetParent(); m_Main->YouCombo();
|
|
|
|
|
How to split the window in following way?
1st row should be divided in 2 columns.
2nd row should be in single column.
|
|
|
|
|
by using CSplitter. If not using MFC then you will have to create your own splitter controls.
|
|
|
|
|
I have used that technique, but whenever i split window in that way it gives some exception.
|
|
|
|
|
First create a splitter window with two rows (panes). In the top pane, create another splitter window with two columns (panes). If you are using MFC, check out CSplitterWnd .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have used the same technique, but it gives some exception.
|
|
|
|
|
What exception is thrown? I assume you've stepped through your code using the debugger. What has it revealed?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Hi..
can u plz help me how to create XML file from MFC filed vales and .. How to parse at client..
..swamy
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Sir,
I want to learn hardware interfacing .For that before going for coaching I want to know what should I must have learned and what should be the basic language to go for hardware interfacing.and what r the other skills required
to learn hardware interfacing.
please help.
|
|
|
|
|
In Windows NT and up, you will need to develop a driver in order to access the hardware.
So get a copy of the Windows DDK (Driver Development Kit). Read the documentation, and have a close look at the samples.
A suitable laguage for developing drivers is C(++), so you can use VC++.
All driver samples I have seen is written in C. But there may be drivers written in other laguages as well.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Sir,
If u would choose hardware interfacing as ur carrier option .Which language would u choose.
PLease suggest
Thanks.
|
|
|
|
|
IMO, C is the most suitable language to use for creating drivers in Win32.
Take a look at the samples in the DDK, as far as i know, they are all written in C.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I know it doesn't answer your question, but you can do limited hardware access (do I/O port access) without writing a device driver. Do a google search for InpOut32.dll.
Using InpOut32.dll is a lot easier than writing device drivers if you are not doing anything complicated.
Of course it depends what you mean by "hardware interfacing".
|
|
|
|
|
In my MDI aplication all my child window shows system menu option, when i click minimize button it minimized and i can not see the minimized window near status bar it goes somewhere,and when i click restore down button,nothing wil happen,and system menu get disapperaed.
For that i used childfrm.cpp precreatewindow()
cs.style = WS_CHILD | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MINIMIZE;
But no use?Pls help me.
Anu
|
|
|
|
|
I am using Splitter windows, and in that, while using CListView, i want to place 2 checkboxes in 2 different columns. I know how to place single check box, so only answer how to place 2 checkboxes?
|
|
|
|
|
For multiple checkboxes per item, use a control such as this one.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|