|
create dialog? i have created initially a dialog named landialog. this is the tab dialog.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: i have created initially a dialog named landialog. this is the tab dialog
No matter how many dialog u have created already...
For every dialog you have to create it before using its methods or CDialog's APIs.
Its better u can post your code and explain wht u need?...
Do your Duty and Don't expect the Result
|
|
|
|
|
From main dialog
void NetConfig::OnClearbutton()
{
LANSettings lanPrc;
lanPrc.Create(IDD_LANSETTINGS,GetParent());
lanPrc.ClearAll((LPARAM)this);
UpdateData(TRUE);
}
this is what i need to call
void LANSettings::ClearAll(LPARAM lParam)
{
(GetDlgItem(IDC_EDIT_LSUBNET))->SetWindowText("");
(GetDlgItem(IDC_EDIT_LIPADD))->SetWindowText("");
(GetDlgItem(IDC_EDIT_LGATE))->SetWindowText("");
(GetDlgItem(IDC_EDIT_LDNS1))->SetWindowText("");
(GetDlgItem(IDC_EDIT_LDNS2))->SetWindowText("");
}
when we create the dialog its just entering in to its initdialog.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: lanPrc.Create(IDD_LANSETTINGS,GetParent());
Instead of using GetParent(), use 'this'. Because the parent to the LANSettings dialog is NetConfig, not the Parent of NetConfig.
Otherwise the code seems perfect.Try the above...
Do your Duty and Don't expect the Result
|
|
|
|
|
yes thers no error but it does not clear the edit boxes(done in the function)
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
The code seems perfect. But i have a doubt, is your edit boxes values are string. If so then the code will work.
But if your edit boxes values are integer then u have to use
SetDlgItemInt(...); as StDlgItemInt(IDC_EDIT_XXXX, nValue, TRUE or FALSE);
TRUE for Signed integer and FALSE for unsigned integer
Do your Duty and Don't expect the Result
|
|
|
|
|
its string only
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Then i didn't see anything wrong in the code...
May be for a try..
Remove the UpdateData(TRUE) statement and
Use SetDlgItemText(...) instead of using GetDlgItem(..)->SetWindowTExt(..)
Do your Duty and Don't expect the Result
|
|
|
|
|
actually the problem is its creating another dialog and the changes are upsated there. how to avoid this
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Make the instance as a member to the parent class.
Use the Create API in the OnInitDialog() method of the Parent class.
Then use the instance (member of that class).
Actullay i forget ut class names, so see the below ex.
class CParentClass
{
CChildClass m_wndChild;
};
BOOL CParentClass::OnInitDialog()
{
CDialog::OnInitDialog();
m_wndChild.Create(IDD_XXX, this);
....
}
xxx CParentClass::ButtonClick(..)
{
m_wndChild.ClearEditControls(..);
}
Hope its clear..
Do your Duty and Don't expect the Result
|
|
|
|
|
sorry it not working again the same problem. thanks a lot for helping me. ok can you tell me how to close the parent dialog from the tabdialog. close netconfig from landialog
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: how to close the parent dialog
This is the first question u posted...
See my answer...
Do your Duty and Don't expect the Result
|
|
|
|
|
sorry i cant understand that can you please send me the sample code
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
GetParent()->EndDialog(nValue);
or
GetParent()->DestroyWindow();
nValue may be any numeric value... this will be the return value of DoModal
Do your Duty and Don't expect the Result
|
|
|
|
|
EndDialog gets an error "'EndDialog' : is not a member of 'CWnd'" and i cant use the other since this will close all the windows(running in background)
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: EndDialog gets an error "'EndDialog' : is not a member of 'CWnd'"
EndDialog is a method of CDialog and not CWnd, Just use MSDN...
you can find even more ways to do your job...
All these are simple tasks and u cn definetly get a way by browsing MSDN...
Use like this,
((CDialog*)GetParent())->EndDialog(...);
deeps_cute wrote: cant use the other since this will close all the windows(running in background)
EndDialog will also do the same... because u are closing the parent window, so all of its child window will be destroyed...
Do your Duty and Don't expect the Result
|
|
|
|
|
thank you very mech its working well. thanks for ur timely help
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Parthi_Appu wrote: Do your Duty and Don't expect the Result
Nice Quote.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Hey Thanx..
But the quote was taken from Bahavat Gita (Ctrl+C, Ctrl+V) :->
Do your Duty and Don't expect the Result
|
|
|
|
|
I think property pages is better way for this kind of concept.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Hi,
I have a small query regarding HANDLE. What exactly it means. what type of data it will stores. Is there an specific structure
ot the HANDLE
Chinna.
|
|
|
|
|
A number assigned to a window that is used by the operating system to keep track of the attributes of the window. In a C or C++ library, a handle is a pointer.
For more information please go through the MSDN.
Regards,
Paresh.
|
|
|
|
|
I could be many things. It could be one thing in one OS version and an entirely different beast in another OS version. Possible implementations are indexes into arrays, keys into hash tables, a pointer to a data structure… The important thing is that all operations go through APIs so the OS is free to change the implementation and the code will still run without needing to be altered; as long as the size of the HANDLE doesn't change.
Steve
|
|
|
|
|
Kotesh.N wrote: Is there an specific structure
you can see it as memeory location!
|
|
|
|
|
when i import a dialog from dll, i can't paste sth to the editbox on the dialog with ctrl+v,how can i make it!!
help me!!!
|
|
|
|