Solved

Clock

Posted on 1998-06-01
6
290 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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. …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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.

856 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