|
I still have lot to learn, thanks for the advice I had thought use the do... while (!m_bDlgOk)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
toxcct wrote: to restrict an edit to a given range, you could attach it a spin control.
That would not keep the user from typing 11 into the control.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
yeah, i figured that out after i posted...
|
|
|
|
|
in MFC you can use:
DDV_MinMaxInt(pDX, IDC_EDIT_BOX, 1, 10);
in the function DoDataExchange of your dialog...
|
|
|
|
|
Haroon Sarwar wrote: DDV_MinMaxInt(pDX, IDC_EDIT_BOX, 1, 10);
This is a bad idea as it falsely gives the user the impression that everything is fine until they decide to click the OK button. Then they get some sort of error message. It's better to disable the OK button until all controls contain valid data.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks for the piece of code.. now i have another doubt.. can i use this piece of code multiple times in the DoDataExchange Function..
something like this,
<br />
DDX_Control(pDX, IDC_EDIT1, m_edit1);<br />
DDX_Text(pDX, IDC_EDIT2, m_edit2);<br />
DDX_Text(pDX, IDC_EDIT3, m_edit3);<br />
DDV_MinMaxInt(pDX, IDC_EDIT1, 1, 10);<br />
DDV_MinMaxInt(pDX, IDC_EDIT2, 1, 20);<br />
DDV_MinMaxInt(pDX, IDC_EDIT3, 20, 30); <br />
|
|
|
|
|
Chandrasekharanp wrote: ...can i use this piece of code multiple times in the DoDataExchange Function..
Yes, but they don't do validation until the OK button is clicked.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Are you using MFC? What is it that you are wanting to do if the entered value is out-of-range (e.g., disable the OK button)? A simple solution is to handle the EN_CHANGE notification.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
yes i am doing this in MFC. when it enters out of range it should pop up a message.. that can be done.
|
|
|
|
|
If you provided a handler for the EN_KILLFOCUS notification, you could do validation at the time the control loses focus. Still not an optimal solution IMO.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Can anybody tell me how to insert an icon in dialogue box ?
Regards,
Shaiju
|
|
|
|
|
in the resource editor add a picture control and set it's Type to Icon, then set the Image property to the ID of the icon...
|
|
|
|
|
You must use of LoadIcon for load icon and then use of SetIcon of course you need to a static control.
|
|
|
|
|
Can anybody explain me how to insert a Control Panel Icon in Edit box ?
Regards
|
|
|
|
|
Edit controls typically do not contain icons. What exactly are you trying to accomplish?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi ALL,
I am using Propertysheet class in my project in which I add number of
pages in it.
I want to acccess pointer of this propersheet in one menu function.
void
CMainFrame::OnOpenWebSite()
{
COpenWebSiteShet openWebSiteDlg;
// COpenWebSiteShet derived from CProperSheet class.
if(ID_WIZFINISH == openWebSiteDlg.DoModal())
{
COpenWebSiteShet *pSheet = (COpenWebSiteShet*)GetParent();
}
pSheet is always get NULL handle. So how can get the correct handle of
propertySheet in Mainframe class.
Thanks in Advance
Om
|
|
|
|
|
You could try this :-
void
CMainFrame::OnOpenWebSite()
{
COpenWebSiteShet openWebSiteDlg;
// COpenWebSiteShet derived from CProperSheet class.
if(ID_WIZFINISH == openWebSiteDlg.DoModal())
{
COpenWebSiteShet *pSheet = &openWebSiteDlg;
}
the GetParent() is going to try and return the CMainFrame's parent, which is in most cases as you noted NULL, and you already have the address of the PropertySheet because you created it on the stack.
|
|
|
|
|
At the point you are calling GetParent() , the window associated with openWebSiteDlg has been destroyed. Once DoModal() has returned, you can only access openWebSiteDlg 's member variables.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i have a console application.
how can i detect when the process is terminated through task manager?
i tried using SetConsoleCtrlHandler() function. it catches the signal when we end the task through task manager. but it can not detect when the process is terminated from the processes tab of task manager.
can anyone help me.
Thanks in advance.
|
|
|
|
|
harsha u wrote: how can i detect when the process is terminated through task manager?
you can't determine when application is cut off by TaskMagr!. there is no way except you put a monitoring application which monitor application at regular interval.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thanks a lot Alok.
That gave me some clarification.
|
|
|
|
|
Hi,
Is there any way to load *.mht files from a stream and view them in a CHTMLView ?
I tryied the microsoft's sample that loads a string or html file using streams and it worked perfectly, but it does not working with
mht files.
Any ideas ?
Regards,
sdancer75
|
|
|
|
|
How to avoid warning LNK4224: /COMMENT is no longer supported; ignored in Visual 2005 .please reply me ASAP
|
|
|
|
|
What about removing the /COMMENT option from the linker command line (Project properties)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
#pragma warning (disable: XXXX)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|