VB / DLL Issues
- From: stumorgan@xxxxxxxxx
- Date: 4 Oct 2006 12:40:26 -0700
I'm running a device driver DLL from my VB program. Each time I want
to access the device, I run an Initialize command to the driver then go
about my business reading data and when I am finished with the device I
issue a Kill command to the driver. The driver flawlessly returns data
at 100 Hz the first time I run it from my program, but on subsequent
runs it only returns at 33 Hz. However, and this is where I am totally
baffled, if I simply minimize my program and maximize it again between
runs, it will always flawlessly run at 100 Hz. Is there any sort of
rational explanation for this? I can only think of 2 possibilities:
1) There is some code being run when I lose or gain focus in my program
that is resetting the driver. I'm fairly sure this is not the case
(but since the program is large and written by several people I can't
be entirely sure. I've skimmed over the open forms to make sure the
GotFocus and LostFocus functions aren't doing anything and from what I
can tell they are not at fault.)
2) For some reason Windows is not letting go of that driver that I've
supposedly killed until after my program has lost focus. If this is
the case, is there some way for me to force Windows to release it after
I've asked it to kill itself?
If you have any other ideas I'd be very very happy, this has been
plaguing me for 2 days now.
Thanks,
Stu
.
- Follow-Ups:
- Re: VB / DLL Issues
- From: Ken Halter
- Re: VB / DLL Issues
- Prev by Date: Re: Trying to be 'well behaved' under Vista
- Next by Date: VB Error - update
- Previous by thread: Re: Trying to be 'well behaved' under Vista
- Next by thread: Re: VB / DLL Issues
- Index(es):