|
ok but how to use it im note to call some function of other class in thread funtion if u say then i can send my code...plzzzzzzz help me its really very very imp....
|
|
|
|
|
Did you bother to read and fully understand those two links I sent? If not, then don't bother continuing.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i need a program with visual c++ to get a bmp file from input and show that in output.
|
|
|
|
|
sahar.safi wrote: i need a program with visual c++ to get a bmp file from input and show that in output.
You can find many articles in the code project which does the above task. Just search...
nave
|
|
|
|
|
tanks
|
|
|
|
|
sahar.safi wrote: tanks
Military?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
|
i search but i cant find it
|
|
|
|
|
sahar.safi wrote: i search but i cant find it
hmmm
check this atricle
http://www.codeproject.com/bitmap/JrsCExBitmap.asp[^]
I didnt check the above one, but i think it will do.Basically to Load and display an image, the steps invloved are.
1. Load the image using LoadImage() API. It will return a HBITMAP.
2. create a device context and select the above HBITMAP to it.
3. Use BitBlt function to copy the image in the above created DC to original one( obtained using GetDC()).
nave
|
|
|
|
|
Just what did you search for? See here, and here, and here, and here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
thank you
|
|
|
|
|
|
thank you
|
|
|
|
|
what do you mean by input?
|
|
|
|
|
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?
|
|
|
|