Hi Christian,
>> Please, I need explanation about ACE Task and ACE ThreadManager,
>>
>> ACE VERSION: 5.2
Wow, that's a REALLY old version of ACE. I recommend that you upgrade
to ACE+TAO x.4.7, which you can download from
http://deuce.doc.wustl.edu/Download.html
under the heading "latest beta kit".
>> PC Pentium 4 3.2Ghz - Windows XP Pro
>> Visual C++ 6.0 sp6
>>
>> A little example to explain my problem :
>>
>> class Task : public ACE_Task_Base
>> {
>> ...
>> int open (void *args=0)
>> {
>> return activate ();
>> }
>> ....
>> int svc (void)
>> {
>> // INIT : create apps window
>> //********************************
>> WNDCLASS wndclass;
>> HINSTANCE hInst;
>> hInst = NULL;
>> // Register display window class
>> ...
>> ::RegisterClass (&wndclass) ;
>> ...
>> m_hWndMain = ::CreateWindow ("name", str, WS_OVERLAPPEDWINDOW,
>> atx, aty, vsize, hsize, NULL, NULL, hInst, NULL);
>> ....
>>
>> // LOOP
>> //*********
>> while ( ) {
>> ...
>> if (::GetMessage( &msg, NULL, 0, 0 )) <= 0) {
>> return -1;
>> }
>> ...
>> };
>> ...
>> return 0;
>> }
>> ...
>> }
>>
>> In fact, if I take out the Init part of the svc () method
>> and I put in the init method (for exemple in open () method ),
>> the thread doesn't work !
>>
>> Someone could tell me why ???
I think Windows stores the windows information in thread-specific
storage, so you need to make sure that the thread you use t initialize
the window is the same one you use to process of messages.
Take care,
Doug
--
Dr. Douglas C. Schmidt Professor and Associate Chair
Electrical Engineering and Computer Science TEL: (615) 343-8197
Institute for Software Integrated Systems WEB:
www.dre.vanderbilt.edu/~schmidt
Vanderbilt University, Nashville TN, 37203 NET: d.schmidt@...