|
i need a program with visualc++to get a bitmap file from user and show it output
sahar
|
|
|
|
|
|
You can use of LoadImage for load a bitmap file and use of WM_ERASEBKGND for show it or use of a control for show it,if you need to show other formats like jpg,... you can use of CImage class or GDI+ and I think your purpose of Input is a control like Editbox that user enter name and path of file if yes you need to use of GetWindowText for read current value of Editbox
|
|
|
|
|
im not undrestand
sahar
|
|
|
|
|
Its easy you use of LoadImage for read file of disk that extension of file is bmp it returns a handle of file hbitmap,now you can use of a event(WM_ERASEBKGND) for show this file I saw Naveen R explain for you on the three steps.
but other way you can insert a Static control on the forum and declare a variable for it and use of m_Static.SetBitmap(handleoffile);
|
|
|
|
|
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
|
|
|
|
|