要先uses一个Unit,大概是ActiveX或者ComServ,你试试吧。

解决方案 »

  1.   

    我查了,只要uses ComServ就可以了。
    否则就是你的Delphi不对。
      

  2.   

    问题依旧,我用的是delphi6+pack2 啊。
      

  3.   

    Form.Create(Sender: TObject)
    begin
        Coinitialize
    end;
      

  4.   

    是否用了多线程?
    如是,在该线程里加上CoInitialize和CoUninitialize。
    原因如下(引自msdn):
    This function initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA). Applications must initialize the COM library before they can call COM library functions other than CoGetMalloc and memory allocation functions.