我用DELPHI 7 在ActiveX 加入一个Active Server Object编写了一个ASP组件,安装到服务器时出现以下错误:
Server 对象 错误 'ASP 0177 : 80080005' 
Server.CreateObject 失败 
/test.asp,行 8 
80080005 开始我以为是组件代码有误,我又创建了一个空的(无实际代码)的组件,结果还是一样,请问各位,报出这种错误是何原因,服务器组件注册的问题还是组件编写设置问题,或是编译选项的问题,请详细说明。

解决方案 »

  1.   

    我用DELPHI 7 在ActiveX Library加入一个Active Server Object编写了一个ASP组件,安装到服务器时出现以下错误: 
    Server 对象 错误 'ASP 0177 : 80080005' 
    Server.CreateObject 失败 
    /test.asp,行 8 
    80080005 开始我以为是组件代码有误,我又创建了一个空的(无实际代码)的组件,结果还是一样,请问各位,报出这种错误是何原因,服务器组件注册的问题还是组件编写设置问题,或是编译选项的问题,请详细说明。
      

  2.   

    library WebTest;uses
      ComServ,
      WebTest_TLB in 'WebTest_TLB.pas',
      Unit1 in 'Unit1.pas' {WebTest1: CoClass};exports
      DllGetClassObject,
      DllCanUnloadNow,
      DllRegisterServer,
      DllUnregisterServer;{$R *.TLB}{$R *.RES}begin
    end.
    unit WebTest_TLB;// ************************************************************************ //
    // WARNING                                                                    
    // -------                                                                    
    // The types declared in this file were generated from data read from a       
    // Type Library. If this type library is explicitly or indirectly (via        
    // another type library referring to this type library) re-imported, or the   
    // 'Refresh' command of the Type Library Editor activated while editing the   
    // Type Library, the contents of this file will be regenerated and all        
    // manual modifications will be lost.                                         
    // ************************************************************************ //// PASTLWTR : 1.2
    // File generated on 2009-2-1 13:57:10 from Type Library described below.// ************************************************************************  //
    // Type Lib: D:\Search\Yellorpage\WebTest\WebTest.tlb (1)
    // LIBID: {FEDCAA4A-0407-41FF-8BA0-93BAC0B6E6E8}
    // LCID: 0
    // Helpfile: 
    // HelpString: WebTest Library
    // DepndLst: 
    //   (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
    //   (2) v4.0 StdVCL, (C:\WINDOWS\system32\stdvcl40.dll)
    //   (3) v4.0 StdVCL, (C:\WINDOWS\system32\stdvcl40.dll)
    //   (4) v4.0 StdVCL, (C:\WINDOWS\system32\stdvcl40.dll)
    // ************************************************************************ //
    {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
    {$WARN SYMBOL_PLATFORM OFF}
    {$WRITEABLECONST ON}
    {$VARPROPSETTER ON}
    interfaceuses Windows, ActiveX, Classes, Graphics, StdVCL, Variants;
      // *********************************************************************//
    // GUIDS declared in the TypeLibrary. Following prefixes are used:        
    //   Type Libraries     : LIBID_xxxx                                      
    //   CoClasses          : CLASS_xxxx                                      
    //   DISPInterfaces     : DIID_xxxx                                       
    //   Non-DISP interfaces: IID_xxxx                                        
    // *********************************************************************//
    const
      // TypeLibrary Major and minor versions
      WebTestMajorVersion = 1;
      WebTestMinorVersion = 0;  LIBID_WebTest: TGUID = '{FEDCAA4A-0407-41FF-8BA0-93BAC0B6E6E8}';  IID_IWebTest1: TGUID = '{E9D87FCE-6C4C-4E27-8537-02999BA5B611}';
      CLASS_WebTest1: TGUID = '{7807C3D7-EF49-49B6-8A77-097839D020E6}';
    type// *********************************************************************//
    // Forward declaration of types defined in TypeLibrary                    
    // *********************************************************************//
      IWebTest1 = interface;
      IWebTest1Disp = dispinterface;// *********************************************************************//
    // Declaration of CoClasses defined in Type Library                       
    // (NOTE: Here we map each CoClass to its Default Interface)              
    // *********************************************************************//
      WebTest1 = IWebTest1;
    // *********************************************************************//
    // Interface: IWebTest1
    // Flags:     (4416) Dual OleAutomation Dispatchable
    // GUID:      {E9D87FCE-6C4C-4E27-8537-02999BA5B611}
    // *********************************************************************//
      IWebTest1 = interface(IDispatch)
        ['{E9D87FCE-6C4C-4E27-8537-02999BA5B611}']
        procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
        procedure OnEndPage; safecall;
      end;// *********************************************************************//
    // DispIntf:  IWebTest1Disp
    // Flags:     (4416) Dual OleAutomation Dispatchable
    // GUID:      {E9D87FCE-6C4C-4E27-8537-02999BA5B611}
    // *********************************************************************//
      IWebTest1Disp = dispinterface
        ['{E9D87FCE-6C4C-4E27-8537-02999BA5B611}']
        procedure OnStartPage(const AScriptingContext: IUnknown); dispid 201;
        procedure OnEndPage; dispid 202;
      end;// *********************************************************************//
    // The Class CoWebTest1 provides a Create and CreateRemote method to          
    // create instances of the default interface IWebTest1 exposed by              
    // the CoClass WebTest1. The functions are intended to be used by             
    // clients wishing to automate the CoClass objects exposed by the         
    // server of this typelibrary.                                            
    // *********************************************************************//
      CoWebTest1 = class
        class function Create: IWebTest1;
        class function CreateRemote(const MachineName: string): IWebTest1;
      end;implementationuses ComObj;class function CoWebTest1.Create: IWebTest1;
    begin
      Result := CreateComObject(CLASS_WebTest1) as IWebTest1;
    end;class function CoWebTest1.CreateRemote(const MachineName: string): IWebTest1;
    begin
      Result := CreateRemoteComObject(MachineName, CLASS_WebTest1) as IWebTest1;
    end;end.
    unit Unit1;{$WARN SYMBOL_PLATFORM OFF}interfaceuses
      ComObj, ActiveX, AspTlb, WebTest_TLB, StdVcl;type
      TWebTest1 = class(TASPObject, IWebTest1)
      protected
        procedure OnEndPage; safecall;
        procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
      end;implementationuses ComServ;procedure TWebTest1.OnEndPage;
    begin
      inherited OnEndPage;
    end;procedure TWebTest1.OnStartPage(const AScriptingContext: IUnknown);
    begin
      inherited OnStartPage(AScriptingContext);
    end;initialization
      TAutoObjectFactory.Create(ComServer, TWebTest1, Class_WebTest1,
        ciMultiInstance, tmApartment);
    end.test.asp
    <%       
    Set cl=Server.CreateObject("WebTest.WebTest1")
    Set cl=Nothing
    %>