Results 1 to 4 of 4

Thread: How to handle handles in vb6, differences during dev and when compiled

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2020
    Posts
    23

    How to handle handles in vb6, differences during dev and when compiled

    So I'm in charge of coming up with working examples of reading and writing from, and to an FTDI chip. there's two of them on a board that we can hook up using one USB cable.

    The FTDI chip ('ft232r') uses a device handle that I open, do something, and close. Each action will either wait for reading a response. So far all from the VB6 IDE.

    I'd rather just keep the handle open until the program would shut down. (If this would be an option, I just simply don't know enough about the subject). So we wouldn't have to open and close it every 10 or 20 ms.

    In my understanding, a handle could be open indefinitely, while no other application needs to make use of it. Which is the case, only my application uses it.

    When using a webcam, for instance, is the handle kept open as long as the webcam is active? or is the stream buffered constantly ( i don't think so but can't find information).

    Or can a handle be kept open 'indefinitely', until the program quits and no other application needs access?

    The 'locked device' happening inside the IDE: Is this just how the IDE is different because "Windows doesn't get to close it for me". Only reconnecting the USB cable will solve the locked device ( there might still be memory in use ).


    According to another 'source': All versions of Windows close kernel handles when an application crashes. Even Windows 95 did this. And certainly, anything based on the Windows NT kernel or later will close kernel handles on an app crash.

    But I'm not using a kernel handle am I? or is this just a way it is described. It's confusing to me.

    Or would/could this mean, that when my application is compiled, and it would crash, I just reopen the handle? I don't know how to test my application crashing while a handle is open.

    i wanted to add:
    Maybe the above is due to not knowing how to create a fatal error inside a compiled program. Because I could then test different use-case-scenario's. Maybe this is as easy as 'doing something wrong'. Like create a button that will assign something to an unassigned array?
    Or did I just answer my own question here?
    Last edited by rikdol; Nov 16th, 2020 at 06:16 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width