Multithreading in visual basic 6.0

前端 未结 5 1141
小蘑菇
小蘑菇 2021-02-19 06:19

How to implement multi-threading in visual basic 6.0. It would be great if someone can give an example.

5条回答
  •  孤街浪徒
    2021-02-19 06:41

    On several projects I have implemented asynchronous processing in VB6 using multiple processes. Basically having a worker thread within an active exe project that is separate from the main process. The worker exe can then be passed whatever data it needs and started, raising back an event to say it's finished or there is data for the main process.

    It's a more resource hungry (an extra process rather than a thread) but VB6 is running in a single threaded apartment and doesn't have any built in support for starting new threads.

    If you really need to have multiple threads within one process I'd suggest looking at using .net or VC6 rather than VB6.

提交回复
热议问题