AttachCurrentThread()
AttachCurrentThread() initializes thread environment, this method requires no parameters.
If the User calls a program utilizing API functions from different threads, this function must be used in order to properly initialize thread environment.
Note
This method must be called before all other APIs if a calling program runs not from a main thread.
Syntax
void AttachCurrentThread()
Exception
Passes an exception in a case of internal error.
Example
AttachCurrentThread();
The method properly initializes environment for a current thread.
Note
Run the corresponding detachCurrentThread() for each instance of attachCurrentThread(). All the threads should be detached using detachCurrentThread() before calling closeService(), else the application may give an unexpected behavior.