在Delphi中,CoInitialize函数用于初始化COM库,并为当前线程创建一个COM的单线程公共调用入口(COINIT_APARTMENTTHREADED)或多线程公共调用入口(COINIT_MULTITHREADED)。它的用法如下:
CoInitialize(nil);
CoInitializeEx(nil, COINIT_MULTITHREADED);