一个关于ExpressWeb Framework中使用ado的问题,50分求解。(50分)

  • 主题发起人 主题发起人 t123
  • 开始时间 开始时间
T

t123

Unregistered / Unconfirmed
GUEST, unregistred user!
在ExpressWeb Framework中使用ado控件一运行就会报错“尚未调用CoInitialize”,只有在
每个form的Create事件中加入Coinitialize(nil),执行才正常,这也太麻烦了,
有没有其他的解决办法?像intraweb那样设置个参数就解决的?
 
这个好像是COM的问题,不太懂:)
但是如果你是因为怕麻烦的话,你可以自已定义一个窗体类然后重裁一下creat方法
 
How do I eliminate the "CoInitialize has not been called" error?


COM libraries can be picky about when CoInitialize is called. In order to guarantee it is initialized at the proper time, use the following unit (save it as ComInit.pas):


unit ComInit;

interfaceuses
ActiveX;

implementationinitialization
CoInitializeEx(nil,COINIT_MULTITHREADED);
finalization
CoUninitialize;
end.
Make sure this is the first unit listed in the "uses" statement of your .DPR file. For example:


uses
ComInit in'ComInit.pas',
WebBroker,
ApacheApp,
dMain in'dMain.pas'{dmMain: TcxWebHomeDataModule},
wMain in'wMain.pas'{wpmMain: TcxWebPageModule} {*.html;}
 
后退
顶部