C
cashtang
Unregistered / Unconfirmed
GUEST, unregistred user!
我写了一个控件,这个控件生成一个线程,这个线程调用Excel,
我在Execute方法中写
CoInitialize(nil);
try
...// do something
finally
CoUninitialze;
end;
控件可以正常使用,但将关闭窗体时会出来以下的错误:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EOSError with message 'System Error. Code: 1400.
无效的窗口句柄。'. Process stopped. Use Step or Run to continue.
我也试过在单元中写
initialization
CoInitialize(nil,COINIT_MULTITHREADED);
finialization
CoUninitialize;
也出现的相同的错误,请教各位!!
我在Execute方法中写
CoInitialize(nil);
try
...// do something
finally
CoUninitialze;
end;
控件可以正常使用,但将关闭窗体时会出来以下的错误:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EOSError with message 'System Error. Code: 1400.
无效的窗口句柄。'. Process stopped. Use Step or Run to continue.
我也试过在单元中写
initialization
CoInitialize(nil,COINIT_MULTITHREADED);
finialization
CoUninitialize;
也出现的相同的错误,请教各位!!