Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CPU Usage stay high after dialing!

Status
Not open for further replies.

Alabou

Programmer
Jun 12, 2006
5
0
0
CA
Hi,

I made a small dialer that retrive the data from an Excel file. While I am looking for the number to dial, the CPU usage is normal..., about nothing.

As soon as it starting the dialing process, the CPU usage is jumping to 99% and will stay there, until the dialing is done and the port is closed. No problem there.

But when I want to cancel the process by hitting my cancel button (Sub_Command_Click), the dialing will stop and the port will close all right but the CPU usage will not go down. It will stay to 99% until I close my application, wich it does nicely.

On my Sub_Command_Click here is the relevant code that I have:

MSComm1.Output = "ATH" + vbCr
MSComm1.PortOpen = False

But this is not killing the process that is working at that moment. Putting DoEvents or Refresh or a delay do not change anything.

For now, to get rid of the problem I unload the application just after having shell load a fresh copy.

What can cause that? I am using VB5, no service pack.

Thanks!

Alain

 
Just brigning this tread up!

I really wish someone would have an answer to my problem.

Alain
 
Hmm...I'm not intimately familiar with the Comm control, but I would first make sure that there are no properties set that are pulling processor time.

Then, you might find ways to release the instance of the control without shutting down your application.

You could try going through an object, which you set to nothing when you want to stop the process. That might work.

You could put your comm control on another form, which you could unload when you want to stop the process. That might work.

You could also investigate OpenProcess and TerminateProcess from the API.

I hope this gives you a few ideas.

Bob
 
>I really wish someone would have an answer to my problem

My first guess would be

>I am using VB5, no service pack

 
Thanks Bob!

I will try your ideas as soon as I can.

Strongm, wy do you bother to post? I don't see any valuable information in your post. What do you mean and wy do you say that. If you could elaborate at least a little bit, telling what you know, this could be helpfull.

Maybe a way to work around or a place to find service pack, this would help too. Otherwise, it is not helping a bit.

Alain

 
I have simply pointed out (in brief) that using an almost 10 year old development platform with none of the 3 major service packs that were released during it's lifetime is a possible cause of the bug that you are seeing (MSCOMM32.OCX was replaced with a newer version in each SP, as I recall, because of the bugs it contained).

I'm sorry you don't like that answer, or that I didn't do more work for you, but what you do with that information I've given is up to you, not me. I am not your free support desk. Nor is it my fault that VB5 is now out of support, or that as a result the service packs are no longer easily available. And it sure as heck isn't my job to google for you to see if there is are still any sources for those service packs.
 
Yes! That is what I just said!

Wy do you bother to post?

Alain
 
But I must admit that your last post contain some valuable information. Thanks!

Alain
 
Alabou
May I suggest you read the guidelines on forum usage in faq222-2244. Paragraph 8 gives a basic research guide

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Just for future reference, Alabou, I've often found that strongm's single line posts have saved me (and a large number of other people) a good deal of time running down blind alleys. If you read a number of his other posts, you'll realize that he doesn't make posts for idle reasons.

I would investigate strongm's reply, short though it may be, thoroughly before looking into mine in any great detail. If there are indeed bugs in the version of the Comm control that you are using, any of my solutions that worked would be a workaround rather than a fix, and any new service pack application would be at least a step in the direction of a fix.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top