|
For your using OnTimer() you need to inherit your class from CWnd base class.
// Header file should look like this
class CMyTimer: public CWnd
{
...
afx_msg void OnTimer(UINT nIDEvent);
DECLARE_MESSAGE_MAP()
};
// Source file should look like this
....
BEGIN_MESSAGE_MAP(CMyTimer, CWnd)
ON_WM_TIMER()
END_MESSAGE_MAP()
void CMyTimer::OnTimer(UINT nIDEvent)
{
//Todo
}
Do not forget to create a timer object after construction the object
i.e., any where in the program you should -
CMyTimer *pTimer = new CTimer;
pTimer->Create(......);
pTimer->SetTimer(.....);
Your Timer should then work.
|
|
|
|
|
Why would you create a whole class just for a timer? Seems to be overkill.
|
|
|
|
|
|
|
|
hIcon = (HICON)LoadImage(...)
should work
|
|
|
|
|
Try (HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
Thanks
|
|
|
|
|
try
<code>
(HICON)LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
</code>
Thanks
|
|
|
|
|
prefer C++ casts :
hIcon = static_cast<HICON*>(LoadImage(NULL, "menu_two.ico", IMAGE_ICON, 32, 32, LR_LOADFROMFILE));
|
|
|
|
|
Why you delete your post?
|
|
|
|
|
Sorry, I won't do it next time!
I just thought maybe I asked too much today. But it now apparently appears not.
|
|
|
|
|
When you ask a question you get many answers and if some one has like a question he gets his answer
|
|
|
|
|
Hi,
I am using VC++ 6.0. I have created a dialog based application using "MFC AppWizardExe". I have placed some edit boxes on it.
Now if I want to validate the data entered in the edit boxes then how can I achieve the same.
Suppose I have three edit boxes for entering name,age and salary respectively.
How can I make such a validation that user wont be able to entre other than character (A to Z) in name edit box.
Simillarly I dont want to allow the user to enter character / special characters in age / salary edit box.
How can I achieve the above mentioned validations?
|
|
|
|
|
It can be handled in ON_WM_KEYDOWN message handler
-Sarath.
The more you can dream the more you can do - Michael Korda"
|
|
|
|
|
handle WM_CHAR instead. when you get a character that shoulld be allowed in the editbox, then pass it to the base class handler. otherwise, simply don't redirect the call.
|
|
|
|
|
Another alternative is a masked (i.e., formatted) edit control.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
After you place your edit boxes on the dialog, assign them to variables of the type that you want (e.g. int or UINT for age) and then you can specify a range that the data must fit into. This will add DDV_ calls into your DoDataExchange function that will handle everything you need for you (and even pop up a message box if the user enters data outside the range you specified).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Can some explain how, WITH A WORKING EXAMPLE, to display a "Loading" or "Saving" that has no buttons on it, (only a "progress bar") that can be displays ON CALL and timed to destroy itself without user intervention when the loading/saving has been accomplished. I need this for a project I'm developing. EXAMPLES please!
I'm programming using MFC code so I need examples using MFC.
From Larry A Mills Sr
|
|
|
|
|
You can use 'DoModal()' function to show the dialog box and then start a timer using SetTimer() then on 'OnTimer()' event call 'EndDialog(IDOK or IDCANCEL)' to close the dialog.
|
|
|
|
|
I think he needs to hide Open & Cancel in Open/Save File dialog
|
|
|
|
|
Do you need to customize file dialog?
ou need to derived a class from CFileDialog and insert this line ShowWindow(GetDlgItem(GetParent(hDlg),IDOK),0); but see this[^] article of course its insert a preview but its helpful for you
|
|
|
|
|
Depending on what your requirements are, there are a couple ways you can go. If the rest of your application can be disabled while the load/save completes, you can create a dialog, remove the OK/Cancel buttons and place a progress bar on it (along with whatever else you want). When you are loading/saving, create this dialog using DoModal and have it spawn a worker thread to do the loading/saving and pass back progress information as it goes.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi,
I am using VC++ 6.0 version. If I try to have to attach a process from Build->debug->attach to process, the list of processes does not appear on the menu. Are there any setting that I need to do?
|
|
|
|
|
I thing VC Service Pack 5 is needed for this.
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
Is this it? I am having the same problem thanks.
http://support.microsoft.com/kb/194022
Norman Fung
|
|
|
|