|
Viorel. wrote: ::LoadBitmap and optional CBitmap::FromHandle can help.
you can't load Image from File using these function!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
You are right. The image can be loaded from separate file using ::LoadImage function with LR_LOADFROMFILE flag, as was answered by sujtha.
|
|
|
|
|
but LoadBitmap(bitmap resource);not file
whitesky
|
|
|
|
|
You are right. The image can be loaded from separate file using ::LoadImage function with LR_LOADFROMFILE flag, as was answered by sujtha.
|
|
|
|
|
Viorel. wrote: You are right. The image can be loaded from separate file using ::LoadImage function with LR_LOADFROMFILE flag, as was answered by sujtha.
Isn't i answered before Ms Sujtha ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok wrote: Isn't i answered before Ms Sujtha ?
Yes, I missed your message, sorry.
|
|
|
|
|
WhiteSky wrote: ut LoadBitmap(bitmap resource);not file
After long time i win the Leg Race
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi ThatsAlok, how are you,you are absent here !?
i think now you are very fast man not me and one thing where i write ut i write but
whitesky
|
|
|
|
|
WhiteSky wrote: i think now you are very fast man not me and one thing where i write ut i write but
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
anilksingh wrote: How load a bitmap from bmp file at run time
will LoadImage api help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
LoadImage(NULL,szFilename, IMAGE_BITMAP,0,0, LR_LOADFROMFILE|LR_CREATEDIBSECTION);
|
|
|
|
|
<br />
(1) CImage m_Image;<br />
m_Image.Load(filename);<br />
-------------------------<br />
(2) CBitmap m_Bit;<br />
m_Bit.Attach((HBITMAP)::LoadImage(AfxGetResourceHandle(), <br />
filename,IMAGE_BITMAP,0, 0,LR_DEFAULTCOLOR |LR_LOADFROMFILE));<br />
whitesky
|
|
|
|
|
Since my application should handle different types of document with different toolbars , how can I make one toolbar visible or not after the user creates a new document or switches between documents of different types? Please, help me for it. Thanks
|
|
|
|
|
See the scope of you toolbar variable and ....You can modify the toolbar items...
Second: Yopu can create toolbars you want and then you can Load and Unload thm as the document opens of respective type.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
My application supports two document types.I would like to prompt the user for the type of the document he is going to create with appropriate strings, but I don't know how to insert the strings in the default dialog of CWinApp::OnFileNew(). Please, help me for it. Thanks
|
|
|
|
|
I think the strings can be affected by adding new "document template" objects to your application. See the sample and related descriptions for CWinApp::AddDocTemplate function in MSDN.
Perhaps, found the place where the wizard inserted the primary document template for you (somewhere in InitInstance ), and add your own templates there.
|
|
|
|
|
i make a dialog box on which i made edit boxes
now i made a menu in another dialog box menu contain two commands add data
and update data
now i want that when i click on add data menu the dialog box open with all edit boxes enable
and when i click on update data menu the dialog box open with some edit boxes disable
plz tem me how it could be possible
send me code for this
Please mail me
|
|
|
|
|
Give the proper explanation....
You might have disabled them on the UPdate Data. Go through the code again Debug it well and then If you find the problem you can explain it well.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
where should we mail the code to you dear.
You haven't confirmed the mail id .
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Before showing your second dialog, set a boolean flag, for instance:
CMyDialog dlg;
dlg.mDisableSomeControls = true;
dlg.DoModal();
where mDisableSomeControls is a new member of your CMyDialog , of boolean type, initialized to false in CMyDialog constructor.
Next, in CMyDialog::OnInitDialog function, check the mDisableSomeControls value and disable needed controls, for instance:
BOOL CMyDialog::OnInitDialog()
{
. . .
m_cMyEditBox1.EnableWindow(! mDisableSomeControls);
m_cMyEditBox2.EnableWindow(! mDisableSomeControls);
. . .
}
Hope it helps.
-- modified at 7:26 Monday 12th June, 2006
|
|
|
|
|
plz tel me how can i check (mDisableSomeControls )
for updaet menu command how i write
if(............)
{
GetDlgItem(IDC_EDIT1)->EnableWindow(FALSE);
}
wat i write in if statement
Please mail me
|
|
|
|
|
As I understand, you have two menu items -- "Add Data and "Update Data", -- and two handler functions for them in first dialog. In these functions, you probably display your second dialog using:
CMyDialog dlg;
dlg.DoModal();
If this is true, then you have to make changes. In "Add Data" handler, change to:
CMyDialog dlg;
dlg.mDisableSomeControls = false;
dlg.DoModal();
In "Update Data" handler, change to:
CMyDialog dlg;
dlg.mDisableSomeControls = true;
dlg.DoModal();
Then in CMyDialog::OnInitDialog , do something like this:
if(mDisableSomeControls)
{
GetDlgItem(IDC_EDIT1)->EnableWindow(FALSE);
}
Otherwise your program's flow is probably different. Is the menu and menu’s handlers in first dialog, while the controls needed to be disabled are in the second dialog?
|
|
|
|
|
can i know wat is mDisableSomeControls is thsi variable of edit box
Please mail me
|
|
|
|
|
In above solution, mDisableSomeControls is a variable defined by you in your dialog class. Let us say your second dialog class is CMyDialog , so open corresponding MyDialog.h file and add a definition, like this:
class CMyDialog : public CDialog
{
public:
bool mDisableSomeControls;
. . .
};
|
|
|
|
|
thanks a lot
Please mail me
|
|
|
|