Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

Clock

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
Cruiser
Asked:
Cruiser
  • 3
  • 2
1 Solution
 
tma050898Commented:
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
 
CruiserAuthor Commented:
The clock control I built is written in Visual C++.
The application form used is in Visual Basic.
0
 
jhanceCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
CruiserAuthor Commented:
How to make the threads?

0
 
jhanceCommented:
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
 
CruiserAuthor Commented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now