[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Which MFC class to use?

Posted on 1998-10-24
5
Medium Priority
?
207 Views
Last Modified: 2013-11-20
I'm quite new to VC++[5] and I would like some advice...
I am writing a simple program.
I want to create a class  which performs a few bsaic operations but also I can set a timer and catch the timer messages.
Which base class should I use?
Thanks.
0
Comment
Question by:bazzalar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Expert Comment

by:jdyer
ID: 1323804
What type of program is this? Windows or console?

Is this a dialog application or a document/view app?

If it is a windows program then you can use timers. However, there is no timer class in MFC. Instead check out the API calls SetTimer and KillTimer. You will need override the OnTimer function of either your dialog or MainFrame class in order to catch timer events. Do this by going into the ClassWizard, pick the appropriate class and scroll down the messages list until you find WM_TIMER. Add the function.

I can help you more if you provide a little more information on what you are trying to do!

Regards,
  jdyer
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1323805
If the class is for abstract operations, but you need it to be a window, use CWnd as a base class.  If you don't want it to have anything with windows, you don't need to use MFC at all. You can use SetTimer to set a callback form of timer (check it's 4rh parameter).
0
 

Expert Comment

by:rakeshkalra
ID: 1323806
The question is not clear as specified in the above comments.
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 1323807
Please specify exactly what you want to do.
For most purposes, you can use the SetTimer function and map the WM_TIMER message. Write code in the OnTimer() function to do the needful.
0
 
LVL 1

Accepted Solution

by:
polimetla earned 200 total points
ID: 1323808
Dear brother,

1. write  SetTimer(); in initinstance
2. throw class wizard overright OnTimer() funciton.
    what ever you want write code here.
3. in destructor write KillTimer()

any doubts please contact me

with regards,
Bhavani P Polimetla
Bhavani_73@hotmail.com











0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question