For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > September 2004 > Why my program ( VB6 made .exe file) will not release after terminated?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Why my program ( VB6 made .exe file) will not release after terminated?
Boki

2004-09-30, 4:44 am

Dear All,
My VB6 USB program will not be released after program
terminated, I don't know why.
Does it possible I didn't close/release USB control ( CreatFlie API) in
program?

Best regards,
Boki.


Mike D Sutton @ Work

2004-09-30, 3:55 pm

> My VB6 USB program will not be released after program
> terminated, I don't know why.
> Does it possible I didn't close/release USB control ( CreatFlie API) in
> program?


Use the CloseHandle() API call to release a handle created with CreateFile().
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: Http://www.mvps.org/EDais/


Boki

2004-09-30, 3:55 pm

Still stick in memory...@@ .... help me ....

This is DisplayUSB.vbp that shows USB devices information.

========================================
===========
Private Sub Form_Unload(Cancel As Integer)

Dim ControllerIndex&
Dim HostControllerName$
Dim HostControllerHandle&
Dim SA As Security_Attributes

'
For ControllerIndex& = 0 To 3

HostControllerName$ = "\\.\HCD" & ControllerIndex&
HostControllerHandle& = CreateFile(HostControllerName$, &H40000000, 2,
SA, 3, 0, 0)


CloseHandle (HostControllerHandle&)
Next ControllerIndex&



End Sub
========================================
============

Best regards,
Boki.

"Mike D Sutton @ Work" <EDais@mvps.org> ¦b¶l¥ó
news:erkvuxtpEHA.3724@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
>
> Use the CloseHandle() API call to release a handle created with

CreateFile().
> Hope this helps,
>
> Mike
>
>
> - Microsoft Visual Basic MVP -
> E-Mail: EDais@mvps.org
> WWW: Http://www.mvps.org/EDais/
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com