Board index » cppbuilder » Threading and use of ActiveX controls - please help
bar
![]() CBuilder Developer |
Mon, 21 Jul 2003 01:40:30 GMT
|
bar
![]() CBuilder Developer |
Mon, 21 Jul 2003 01:40:30 GMT
Threading and use of ActiveX controls - please help
Hi-
In previous posts I reviewed that I have been trying to get a set of working ActiveX controls working in a multi-threaded program. If I use the controls in a single threaded program - no problem. Previous replies indicated that calls to CoInitialize and Perhaps I did not make the calls to init COM correctly or perhaps TIA |
Francois Belai
![]() CBuilder Developer |
Tue, 22 Jul 2003 01:54:52 GMT
Re:Threading and use of ActiveX controls - please helpSalutation bart, Quote> If I use the controls in a single threaded program - no problem. Quote> Previous replies indicated that calls to CoInitialize and with a missing apartment is that you will not be able to create a COM component or the called to the method of the component will always fail. When you include an ActiveX in a project, it will automatically have an So good rule of thumb is always create an apartement for each new thread or Quote> Perhaps I did not make the calls to init COM correctly or perhaps The only problem i could see is if the ocx is single thread only (meaning only one thread can ever access the file at anytime). I suppose in that case the activeX create would fail for the second thread (never test that so i don't know) Another point to consider is that you probably use the class wrapper of the It might be good to actually use a raw interface pointer on your activeX and In each thread you could try this instead : IYourActiveX* pActiveX = 0; // The thread start // Create the activeX, you will have to replace the GUID_ and the IID_ if( SUCCEEDED(hr) ) // Do other stuff // Eventually we are done // And the thread is gone Doing so you can check the hr value if you are able to create the Hope this helps. Francois Belair |
bar
![]() CBuilder Developer |
Wed, 23 Jul 2003 03:49:59 GMT
Re:Threading and use of ActiveX controls - please helpThank you again my friend. I will experiment with this approach. I had hoped to use the imported controls, however it does appear that On Thu, 1 Feb 2001 12:54:52 -0500, "Francois Belair" Quote<fbel...@infopharm.ca> wrote: |
1. Please Help: Using SQLServer 2000 Merge ActiveX Control
2. Using DHTML ActiveX Controls in D4 - Please Help
3. Using ActiveX controls in BCB3 - Please help me...
4. PLEASE HELP --- Using ActiveX within D3 ---- PLEASE HELP
5. Newbie question: Using activex control in a thread
6. BIG problem with threads->ActiveX, PLEASE HELP !
7. PLEASE HELP : Imported ActiveX control with Transparent background ...
8. repost - please help (size of activex controls not stored)
9. Odd performance problems with ActiveX controls, Please help
10. Please help on OLE error using Outlook_TLB from a thread