Previous | Index | Next 

[INFO] Multithreaded VB6 applications don’t retain their multithreading behavior

The most common technique to implement a multi-threaded VB6 application is compiling the application as an ActiveX EXE component, having it expose a SingleUse class, and ensuring that the threading model option is set to Thread per Object. If the application creates an instance of such a class by means of a CreateObject method, then the code inside that instance runs in a different thread.

This threading model isn’t supported under the .NET Framework. Applications of this kind can be migrated to .NET without any error, but are converted to standard EXE projects. Instantiating the class with CreateObject still works, but the created instance runs in the same thread as the application.

The only way to implement a robust multi-threaded .NET application is by means of classes defined in the System.Threading namespace.

 

Previous | Index | Next