Library guang;
uses
  ComServ,
  SysUtils,
  Classes,
  StrUtils,
  md5 in 'md5.pas',
  main in 'main.pas';
{$R *.res}
exports
  DllGetClassObject,
  DllCanUnloadNow,
  DllRegisterServer,
  DllUnregisterServer,
main.get_snClick;
begin
end.
编译成dll时候,,再delphi中建立一个exe程序调用dll成功,,但是放到ASP中调用的时候提示
Server 对象 错误 'ASP 0177 : 800401f3' Server.CreateObject 失败 ASP代码为
<%Set objConnection9 = Server.CreateObject("guang.main")%>
guang.dll已经注册在system32中了,,希望大侠帮忙~~~~~~

解决方案 »

  1.   

    ASP中调用的dll与普通dll不同
    Delphi的File/New/Other.../ActiveX页面/ActiveX Library  
            File/New/Other.../ActiveX页面/Active Server Object
      

  2.   

    Delphi的File/New/Other.../ActiveX页面/ActiveX Library 我在这里建了一个工程,,
    library funclt;uses
      ComServ,
      md5 in 'md5.pas',
      main in 'main.pas';exports
      DllGetClassObject,
      DllCanUnloadNow,
      DllRegisterServer,
      DllUnregisterServer;{$R *.RES}begin
    end.
    main 的代码为:
    unit main;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
      Dialogs, StdCtrls, StrUtils, md5;    function get_snClick(D: PCHAR): PCHAR; export;
    implementationfunction get_snClick(D: PCHAR): PCHAR; export;var
      getidstr:String;
    begin
       getidstr := String(D);
       result := Pchar(getidstr);
      end;end.
    编译成dll后在 asp调用,asp代码为
    <%Set objConnection9 = Server.CreateObject("funclt.main")%>
    还是出错:Server 对象 错误 'ASP 0177 : 800401f3' Server.CreateObject 失败 funclt.dll在system32中已注册成功了
      

  3.   

    这个建了吗?
    File/New/Other.../ActiveX页面/Active Server Object
      

  4.   

    呀  File/New/Other.../ActiveX页面/Active Server Object也要建呀 不知道怎么建,我去看看
    我还以为挑一个建就好了 我去查查怎么建
      

  5.   

    Delphi的File/New/Other.../ActiveX页面/ActiveX Library  
            File/New/Other.../ActiveX页面/Active Server Object
    不知道怎么连起来   不懂,,能不能说的详细点呀
      

  6.   

    先建立一个Delphi的File/New/Other.../ActiveX页面/ActiveX Library  
    然后再建立File/New/Other.../ActiveX页面/Active Server Object
    在New Active Server Object对话框的CoClass Name填写类名,其他默认例如类名Test则生成
    unit Unit2;{$WARN SYMBOL_PLATFORM OFF}interfaceuses
      ComObj, ActiveX, AspTlb, Project1_TLB, StdVcl;type
      TTest = class(TASPObject, ITest)
      protected
        procedure OnEndPage; safecall;
        procedure OnStartPage(const AScriptingContext: IUnknown); safecall;
      end;implementationuses ComServ;procedure TTest.OnEndPage;
    begin
      inherited OnEndPage;
    end;procedure TTest.OnStartPage(const AScriptingContext: IUnknown);
    begin
      inherited OnStartPage(AScriptingContext);
    end;initialization
      TAutoObjectFactory.Create(ComServer, TTest, Class_Test,
        ciMultiInstance, tmApartment);
    end.
    Test.asp测试页面
    <HTML>
    <BODY>
    <TITLE> Testing Delphi ASP </TITLE>
    <CENTER>
    <H3> You should see the results of your Delphi Active Server method below </H3>
    </CENTER>
    <HR>
    <% Set DelphiASPObj = Server.CreateObject("Project1.Test")
       DelphiASPObj.{Insert Method name here}
    %>
    <HR>
    </BODY>
    </HTML>