|RE: No, it merely starts the thread at the address pointed to by start_address.
That makes sense, the class must be instantiated before passing in the one method to CreateThread().
But, since the main app has created the class and has its address, what prohibits the main app from calling methods in the class? Yes, I am mostly aware of problems that may cause. My intent is to call methods such as:
Set_Logging_Flag( bool new_value );
These methods would just set flags that the thread would detect then act upon.
Note that I wrote "mostly aware of" as I am certain there are things of which I am not aware.
Edit shortly later:
Following the codeproject article resulted in the following in the dot H file:
void Main_TCP_Class( void * common_structure );
static unsigned __stdcall ThreadStaticEntryPoint( void * pThis )
C_Server_TCP_Win_Api * p_C_Server_TCP_Win_Api = (C_Server_TCP_Win_Api * )pThis;
p_C_Server_TCP_Win_Api->Main_TCP_Class( m_common_data );
static st_server_tcp_common_structure *m_common_data;
The compile failed until I declared the common structure static. OK. But one of the goals was to pass one argument to the thread and that argument could be a structure through which the main app communicates with the thread.
Possible Revelation: Since we declare that structure as static, and the main app instantiates the class before starting it as a thread, it has access to that static class regardless of how the class is run. So why go through all this to pass the argument?
Thanks for your time
If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig_106/
modified 26-Nov-13 16:32pm.