|
Hi
I want to send some orders from a dialog box to another?I tried to use SetOwner() and GetOwner() methods but I couldn't.If these methods can solve the problem how should I use them?If there is another way please let me know it.
|
|
|
|
|
iayd wrote: I want to send some orders from a dialog box to another
Aleast you must have the handle of the second dialog. If so, you can send custom messages to it.
nave
|
|
|
|
|
But I am beginner so I couldn't understand the answer.Here is what I did;
in first dialog box;
BOOL CDlg1::OnInitDialog()
{
CDialog::OnInitDialog();
CDlg2 *dlg2 = new CDlg2;
CWnd::SetOwner(dlg2);
return TRUE;
}
In sacond dialog box(I am trying to write something to the edit box of first dialog box when I push a button in second dialog box)
void CDlg2::OnButton1()
{
CDlg1 *dlg = (CDlg1*) GetOwner();
dlg->m_edit = "text for the edit box in first dialog box";
}
These two dialog boxes are unrelated.Where is the mistake?
|
|
|
|
|
Ok.. there is some pblm in the code.. Please try the below one
BOOL CDlg1::OnInitDialog()
{
CDialog::OnInitDialog();
CDlg2 *dlg2 = new CDlg2;
dlg2->Create(CDlg2::IDD, this );// by passing the "this" value to the create function of dlg2, we are making the CDlg1 as the parent of dlg2
return TRUE;
}
now in the CDlg2 class
void CDlg2::OnButton1()
{
GetParent()->SetDlgItemText( IDC_EDIT1, "text for the edit box in first dialog box" );
}
// where IDC_EDIT1 is the id of the edit control in the first dialog.
nave
|
|
|
|
|
This code did not write anything to edit box in first dialog box.Is there a mistake in the code?Or I created these two dialog boxes from a main dialog box.Maybe when we write GetParent() it is calling main dialog box as parent.If it is like that how can we ignore this mistake?
|
|
|
|
|
iayd wrote: it is calling main dialog box as parent
ho. In that case modify the create function of the 2nd dialog as follow
dlg2->Create(CDlg2::IDD, &dlg1 );// pass the address of the first dialog in this function.
nave
|
|
|
|
|
We did not declare dlg1.How to declare it?
|
|
|
|
|
By dlg1 I simply mean the first dialog among the two dialog
nave
|
|
|
|
|
Naveen R wrote: dlg2->Create(CDlg2::IDD, &dlg1 );// pass the address of the first dialog in this function.
Which is exactly what dlg2->Create(CDlg2::IDD, this) does.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
What happens if you use of this code
CMain *m_Main=(CMain*)GetParent();
m_Main->yourcontrols
|
|
|
|
|
iayd wrote: I tried to use SetOwner() and GetOwner() methods...
Why?
This question cannot be answered without knowing the relationship between the two dialog boxes and the main window. How is the first dialog created/displayed? The second?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am creating them as modeless from CMain?
|
|
|
|
|
Hi all
I am using polyline function and passing it array of points to draw
lines on them in the windows onpaint event and it's working fine, now requirment is not to draw lines between specific points and these point are changing every time on paint event and also array size increases?
i have drawn an example what i needed and what i already did
*--------------*------*---------------*------------------*--*----*
*--------------* *---------------*------------------* *----* (required)
application is dynamic running on timer events
Regards
Masood
|
|
|
|
|
hello can u help me?
sahar.safi
|
|
|
|
|
Each thread is for a problem if you have a problem or question you can of New Message .
|
|
|
|
|
Engineer Masood wrote: now requirment is not to draw lines between specific points and these point are changing every time
How about keeping an array of points and drawing the lines yourself as necessary?
I'm not sure what the problem here is...
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi All
I am using an API "SetupDiSetClassInstallParams" and many more functions(like SetupDiGetDeviceRegistryProperty etc.)it is working on Admin Login but it fails in User login. So how will i use this function even in Non-Admin User Login.
With Regards
RYK
-- modified at 6:17 Monday 9th April, 2007
|
|
|
|
|
Hello all,
I want to change the name of my SDI Application main window which takes project name automatically. How to do it??
Can anybody help me in this
Thanks in advance
|
|
|
|
|
|
sulabh_expert@rediffmail.com wrote: change the name of my SDI Application main window
AfxGetMainWnd()->SetWindowText( "Some name" );
nave
|
|
|
|
|
Thank you all it solved my problem
|
|
|
|
|
If you need the caption to show run-time data, use SetWindowText() . Otherwise, just change the IDR_MAINFRAME resource string.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello All,
When I tried to build my Win32 app., it showed me the following error.
C:\Program Files\Microsoft Visual Studio\VC98\LIB\LIBCD.lib : fatal error LNK1127: library is corrupt
Error executing link.exe.
WebForm.exe - 1 error(s), 0 warning(s)
Not sure how to eliminate the error. It is regarding the corrupted library LIBCD.Lib. I also tried it with reinstalling the Visual Studio 6.0. Even that didn't rectify the error.
Can anyone please help me out ?
Thanks for prompt reply.
Nikhs
Nikhil Trivedi
Software Developer
-- modified at 7:30 Monday 9th April, 2007
Nikhs
Nikhil Trivedi
Software Developer
|
|
|
|
|
Hi all:
I'm trying to debug a program that is part of a whole VS solution, what special about this program is that it is a separate process but still part of the solution, and this program is launched by a separate "start up project". I've tried to attach this program to the start up project by "attach to process" in VS, but break point at that program's entry point just wasn't hit, it appears disable when "attach to process". Am I doing the right thing?
|
|
|
|