Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering


You are here: Visual Basic > Advanced VB6 tutorial > Chapter 12

Managing Threads in a COM Component

VB6 gives programmers some capabilities for managing threads in COM components. A thread, simply defined, is a single path of execution in a computer.

In Win16 (Windows for Workgroups and Windows 3.x), every application had one and only one separate thread.

In Win32 (Windows 95, Windows NT, and beyond), a single application may use more than one thread. This might be advantageous if the application instantiates multiple objects at the same time. Each object could have its own thread, or the application might have a fixed number of threads to use and could manage its objects across these threads.

All VB6 applications use a type of threading known as apartmentmodel threading. When threads run under the apartment model, the object in each thread is unaware of objects in other threads and has its own separate copy of global data.

NOTE - Can't Use WithEvents in a Standard Module: You can'tuse the WithEvents keyword in a standard module.

The options for threading are different for COM components, depending on the type of component that you are developing. The following sections discuss these options.

 


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved