C chenke Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-10 #1 用线程创建一个窗体,如果不加入Activex控件,一切正常, 如果加入Acticx控件,窗体则不显示了,如何解决?
C CJ Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-10 #2 不用是好的? 那就别用! 我认为ACTIVEX也有线程安全和不安全的,有许多VCL是线程不安全的,它们生成的 ACTIVEX会安全吗?
A Another_eYes Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-10 #5 凡是线程中调用的activeX方法都通过Synchonize实现
A Another_eYes Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-11 #7 你没做,activeX做了, activex控件的create里可能存在线程冲突. 试试动态生成该activeX.
A Another_eYes Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-11 #10 通过Synchonize实现该控件的create
A Another_eYes Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-11 #12 procedure MyThread.CreateActiveXHere; begin // create ur activeX Control dynamically end; procedure MyThread.initialize; begin .... Synchonize(CreateActiveXHere); .... end;
procedure MyThread.CreateActiveXHere; begin // create ur activeX Control dynamically end; procedure MyThread.initialize; begin .... Synchonize(CreateActiveXHere); .... end;
Z ZXL Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-12 #13 在线程启动时初始化COM 试试,即在 TYouThread.Execute 中, CoInitialize (nil); try your Code... finally CoUninitialize ; end;
在线程启动时初始化COM 试试,即在 TYouThread.Execute 中, CoInitialize (nil); try your Code... finally CoUninitialize ; end;
C chenke Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-12 #14 试过another_eyes老宣的方法,可以搞定,但有个很奇怪的现象, 必须先在主程序中创建一下Activx对象,线程中才能创建成功, 否则仍提示同步错误。怎么回事?用ChartFx控件。
C CJ Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-13 #15 eYes果然厉害 难道ACTIVEX没有线程安全问题?或者说没有线程不安全的ACTIVEX?
C chenke Unregistered / Unconfirmed GUEST, unregistred user! 1999-01-15 #16 我的意思在线程中创建一个带ActiveX(FtpClient)控件的窗体,谁先成功了,加80分, 看来得采取一些激将法了。