Click here to Skip to main content
14,328,194 members

ATL / WTL / STL

 
GeneralRe: error WTL Pin
Member 104023901-Dec-13 7:43
professionalMember 104023901-Dec-13 7:43 
GeneralRe: error WTL Pin
Richard MacCutchan1-Dec-13 21:00
protectorRichard MacCutchan1-Dec-13 21:00 
GeneralRe: error WTL Pin
Member 104023902-Dec-13 4:57
professionalMember 104023902-Dec-13 4:57 
QuestionException handling wrapper over MSXML parser Pin
sma123#26-Nov-13 14:16
membersma123#26-Nov-13 14:16 
AnswerRe: Exception handling wrapper over MSXML parser Pin
Richard MacCutchan26-Nov-13 22:49
protectorRichard MacCutchan26-Nov-13 22:49 
Questionuse of beginthreadex() Pin
bkelly1325-Nov-13 16:24
memberbkelly1325-Nov-13 16:24 
AnswerRe: use of beginthreadex() Pin
Richard MacCutchan25-Nov-13 22:44
protectorRichard MacCutchan25-Nov-13 22:44 
GeneralRe: use of beginthreadex() Pin
bkelly1326-Nov-13 8:05
memberbkelly1326-Nov-13 8:05 
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 );
bool Get_Logging_Flag();


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:
// This is the function that is to run as a separate thread.
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 );
    return 1;
...

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.

GeneralRe: use of beginthreadex() Pin
Richard MacCutchan26-Nov-13 22:46
protectorRichard MacCutchan26-Nov-13 22:46 
GeneralRe: use of beginthreadex() Pin
bkelly1327-Nov-13 11:45
memberbkelly1327-Nov-13 11:45 
GeneralRe: use of beginthreadex() Pin
Richard MacCutchan27-Nov-13 22:03
protectorRichard MacCutchan27-Nov-13 22:03 
GeneralRe: use of beginthreadex() Pin
bkelly1328-Nov-13 10:08
memberbkelly1328-Nov-13 10:08 
GeneralRe: use of beginthreadex() Pin
Albert Holguin11-Dec-13 5:01
professionalAlbert Holguin11-Dec-13 5:01 
Generaleasy for classes Pin
bkelly1311-Dec-13 12:27
memberbkelly1311-Dec-13 12:27 
GeneralRe: easy for classes Pin
Albert Holguin12-Dec-13 4:09
professionalAlbert Holguin12-Dec-13 4:09 
GeneralRe: easy for classes Pin
bkelly1312-Dec-13 12:53
memberbkelly1312-Dec-13 12:53 
AnswerRe: easy for classes Pin
Albert Holguin12-Dec-13 13:10
professionalAlbert Holguin12-Dec-13 13:10 
QuestionI want to showing "+" allways in WTL CTreeViewCtrl Pin
cheng84977cc25-Nov-13 5:40
membercheng84977cc25-Nov-13 5:40 
AnswerRe: I want to showing "+" allways in WTL CTreeViewCtrl Pin
Wayne.CN13-Jan-14 17:51
memberWayne.CN13-Jan-14 17:51 
Question[How to Convert data in textBox to .Txt file in Windows Form C++] Pin
Member 1041578020-Nov-13 19:53
memberMember 1041578020-Nov-13 19:53 
QuestionRe: [How to Convert data in textBox to .Txt file in Windows Form C++] Pin
Richard MacCutchan20-Nov-13 22:21
protectorRichard MacCutchan20-Nov-13 22:21 
Questionstl thread safe Pin
G.aius.CodeCreator18-Nov-13 15:38
memberG.aius.CodeCreator18-Nov-13 15:38 
Questionwaiting on events for socket activity Pin
bkelly1318-Nov-13 14:05
memberbkelly1318-Nov-13 14:05 
AnswerRe: waiting on events for socket activity Pin
Orjan Westin19-Nov-13 23:03
professionalOrjan Westin19-Nov-13 23:03 
GeneralRe: waiting on events for socket activity Pin
bkelly1325-Nov-13 16:08
memberbkelly1325-Nov-13 16:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.