Solved

Clock

Posted on 1998-06-01
6
289 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
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.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 120
mixing C++ & C# in Vis Studio 2013 7 170
FMX StringGrid1->Canvas->FillRect Problem 3 150
FMX TCameraComponent Problem 2 68
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

808 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