Solved

Clock

Posted on 1998-06-01
6
287 Views
Last Modified: 2010-04-01
I have made a clock activeX control  for displaying current time.
It is placed together with other controls in a form.
But it has a major weakness.
The clock stop running whenever my application is reading. a file. It resume after that.
I believe it is due to the two cannot run at the same time.
What to do to allow the clock to continue running while doing something else?
Thanks.
0
Comment
Question by:Cruiser
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:tma050898
ID: 1165106
An application like is *definitely* a candidate for mutli-threading. You need to provide more details, however, in order for me (or someone) else to help you in that area. For example, if you're using VC, your options are different than if you are using straight SDK.

Tom

0
 

Author Comment

by:Cruiser
ID: 1165107
The clock control I built is written in Visual C++.
The application form used is in Visual Basic.
0
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
ID: 1165108
While the file is being read, Windows doesn't process the message loop for your application.  I assume that your clock control is settings up a timer and responding to timer events to keep itself updated.  Probably the easiest solution is to run either the clock or the file input function as a separate thread.  This way, each will have it own message loop and the long processing in the file input won't block the clock.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Cruiser
ID: 1165109
How to make the threads?

0
 
LVL 32

Expert Comment

by:jhance
ID: 1165110
In C++ under Win32 you use the CreateThread() API call.  I don't know a lot about VB, but I do know that it's possible to create threads in VB 5.0.
0
 

Author Comment

by:Cruiser
ID: 1165111
The thread is created in the clock control right?
If so, then it is in VC++.
I'm not sure about creating thread, maybe u can give an example?
I will give u 100 more pts if u can help me solve this.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now