API Calls used for Threading (threadapi.tlb)

VB5 and 6 can be used to develop free-threaded DLLs. However, once a new thread has been created you cannot run any VB code at all until the first object has been created on it. This Type Library provides all the Win32 API and COM calls required to initialise an object into a new thread. It also provides a good demonstration of how to translate Win32 API calls into Type Library calls.

Supported calls:

  • OLE32
    CoMarshalInterThreadInterfaceInStream, CoGetInterfaceAndReleaseStream, CLSIDFromProgID, CoInitialize, CoUninitialize, IIDFromString, CoCreateInstance
  • Kernel32
    WaitForSingleObject, CreateEvent, CloseHandle, PulseEvent, SetEvent, ResetEvent, ResumeThread, SuspendThread, InterlockedIncrement, InterlockedDecrement, WaitForMultipleObjects, GetCurrentThreadID, GetCurrentProcessId , GetCurrentProcess, CreateThread , CopyMemory, ZeroMemory, Sleep, InitializeCriticalSection, EnterCriticalSection, LeaveCriticalSection, DuplicateHandle, GetExitCodeThread
  • User32
    PeekMessage, TranslateMessage, DispatchMessage, EnumThreadWindows, GetClassName

To see the Type Library in use, check out the "Free-Threaded In-Progress Components" article.