Using UI-Thread
-
On regard [http://www.codeproject.com/script/comments/forums.asp?msg=1994839&forumid=1647&XtraIDs=1647&sd=20+Jan+2007&ed=20+Apr+2007&author=cdrain&stype=1#xx1994839xx](<a href=)[^]" rel="nofollow">comment Thanks a lot for the help... ok I'm able to create a UI-Thread from my MainWnd as I need to get the ActiveX functionality. My Activex must fill the grid contained on the MainWnd, while the progressBar is incremented. So I set the timer, that increment the progressbar on the OnTimer event, and create the ui-thread using this code I use: thread = new CMyThread(); //Set parameter I need on the ActiveX // Include the pointer to the grid (is it right?) thread->GripPointer= GridPointer; thread->par2 = par2; thread->par3 = par3; thread->CreateThread(); On my ui-thread code i fill the grid on the Run() method and at the end of the operation I PostMessage(..) to the MainWnd and here I close the ui-thread sending a PostMessage(WM_INFORM_CLOSE, 0, 0);. At Run-Time it gives me an error "Not valid pointer' when i call the function to fill the grid on the ui-thread. WHY? - Where I need to use the ::CoMarshalInterThreadInterfaceInStream(...) and ::CoGetInterfaceAndReleaseStream(...) method you said, and witch is they're scope? (Sorry I'm newer in this use ) - Have you an example code? Another question: But can I manage a graphic component of the MainWnd (the grid) from the ui-thread?? Is this my problem? Thanks a lot