|
Not quite sure what you are asking but if you are trying to change the caption of the dialog before you call DoModal() then you should add a CSstring member to your dialog and then in your dialog's OnInitDialog() you should call:
SetWindowText(m_caption);
where m_caption is your CString member.
You should set the text to be displayed before you call DoModal()...
CMyDialog dlg;
dlg.m_caption = "My Dialog Caption";
dlg.DoModal();
Hope this helps - appologies if its not what you were asking.
Tony
|
|
|
|
|
What im trying to do is take data out of the Dialog box and move it to another class. For Example I have a editbox that recieves a string called m_Title. When I click OK i want that string and all of the other strings to be available to another class that directly edits the background of the document.
The program I am editing is very complicated source code my company purchased that is a drawing program similar to Visio, and the TitleBlock I have drawn is in a class that directly edits the background. So I am trying to edit that with a dialog box that is called by a menu in the view class. Sorry if this is confusing im about to give up on it .
|
|
|
|
|
Hmm, there are a few ways of doing this. I think I would create a pointer to your other class as a member of the dialog. You can then freely read and write data from/to your class from the dialog. When you create the dialog you would assign the pointer to the object you want to pass data to, then in your dialog, you could override OnOK to assign the newly entered values using the pointer...
CMyDialog dlg;
dlg.m_ptrToMyOtherClass = &myOtherObject;
dlg.DoModal();
CMyDialog::OnOK()
{
UpdateData(TRUE);
m_ptrToMyOtherClass->m_Title = m_Title;
m_ptrToMyOtherClass->m_classMember = m_dialogClassMember;
CDialog::OnOK();
}
I dont know if this helps.
Tony
|
|
|
|
|
Hi,
In my code i am having some dlls which i downloaded from a site. But while executing the code that dll is calling InvokeHelper method in CWnd class. But in InvokeHelper method i am getting some assertion failed error at file: winocc.cpp and line: 345. I am unable to understand what to do. Please help me.........
|
|
|
|
|
You have to state your problem more, like why you are using that Dll, which method of that Dll you are calling. InvokeHelper is called when there is a COM object which gets or set some properties. In this case may be you are calling some method which expects parameters guided to COM parameter passing.
|
|
|
|
|
hi,
Actually i am tring to connect my system to a handheld device with rs232 port. So, to check the connection between the device and my computer i have to use one control object dll according to OPOS standards. In my control object file i have one method for opening the port. If i call that open method, this method internally calling InvokeHelper method. In the invokeHelper method i am getting assertion failed error. This InvokeHelper method is having one pointer to a class COleControlSite this pointer is showing null. I dont know why it became null, why it is causing the error.
Please help me.............
|
|
|
|
|
So you are using onemethod of that Dll which expect a parameter as COleControlSite. Now this class is related to embedded control, in simple word when you have a container & you want to display a compound object or something like, this class plays an important role. So in your case I suppose this Dll is not the suitable option to open a port. Why do not you use various Open, CreateFile APIs?
|
|
|
|
|
|
depends upon the control you want to implement this to.
For eg:For CEdit you can see EN_SETFOCUS and EN_KILLFOCUS
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi,
I need for Tab control.
|
|
|
|
|
Try to handle TCN_FOCUSCHANGE.
-@SuDhIrKuMaR@-
|
|
|
|
|
AnithaSubramani wrote: How to get the GetFocus and lostfocus in VC++.
This makes no sense at all. Please explain.
AnithaSubramani wrote: I need that focus ll go to next button.
See the WM_SETFOCUS and WM_NEXTDLGCTL messages.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
On parent dialog in OnCommand hendler by checking the control id of WPARAM, you can c heck which control is having the focus.
|
|
|
|
|
How Can I Load External Bitmap File "C:\\Test.bmp"
To A CBitmap Object
Thanks
|
|
|
|
|
Call LoadImage() first, then use CBitmap::Attach() .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you
I Have Tried It Before (Ask This) , But Nothing Was Happen .
Ok I Think I Am On Correct Way ,I Will Try It Again
Thank You Anyway
|
|
|
|
|
Use LoadImage() function but i think it works only for .bmp file.
-@SuDhIrKuMaR@-
|
|
|
|
|
Thank You
Yes, I Know
I Need Only Bitmap (.BMP)
Other Formats Are Not Required
|
|
|
|
|
I want to have one diferent cursor for the keyboard.
It must apear when I click the mouse left button.
danginkgo
|
|
|
|
|
So do you need to respond to the WM_SETCURSOR message?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How can I get the value of the alpha channel for every pixel in a bitmap?
danginkgo
|
|
|
|
|
Is this a bitmap in a file, from an HBITMAP?
There are loads of resources in MSDN that will help. If you start with GetDIBits, you can follow the documentation from there.
*IF* a bitmap has an alpha layer, it will be 4 bytes per pixel, one for R, G, B, and A respectively. (Ok, I'm pretty sure A comes first).
You can look at the bitmap header, and see 32 bits per pixel set.
It's quite a bit of fiddly work, but not rocket science.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
OK, thank you for help.
danginkgo
|
|
|
|
|
I use ::GetOpenFileName instead CFileDialog to show the OpenFile Dialog.
accidently I found it(the dialog) a modeless dialog, user can click the button to show as many OpenFile Dialogs as she/he wants, this is not the thing I want.
Is it possible to make ::GetOpenFileName openfile Dialog modal?
|
|
|
|
|
You could try something like this perhaps: Code removed
Sandip's answer is the best way to go about it.
modified on Thursday, July 10, 2008 2:45 AM
|
|
|
|