Delphi 7调用C#写的Web Service,在delphi调试环境下运行调用正常,但delphi生成的程序来调用就报错误,哪位有知道解决方法吗?
HELP,!!!

解决方案 »

  1.   

    问题是直接按F9运行调用就正常呀
    打开生成的EXE程序来运行调用就出现错误了
    何解?都是在本机上的呢
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, InvokeRegistry, Rio, SOAPHTTPClient;type
      TForm1 = class(TForm)
        Label1: TLabel;
        eID: TEdit;
        btApply: TButton;
        lbResult: TLabel;
        HTTPRIO1: THTTPRIO;
        procedure btApplyClick(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}uses Service;procedure TForm1.btApplyClick(Sender: TObject);
    begin
      if Trim(eID.Text) = '' then
      begin
        Application.MessageBox(PChar('ID不能为空!'),PChar('警告'),MB_OK + MB_ICONWARNING);
        Exit;
      end;
      try
        StrToInt(eid.Text);
      except
        Application.MessageBox(PChar('ID不合法!'),PChar('错误'),MB_OK + MB_ICONERROR);
        Exit;
      end;
      try
        lbResult.Caption := (HTTPRIO1 as ServiceSoap).WebUpdate(eid.Text);
      except on e: Exception do
        lbResult.Caption := 'Web Service Error!' + #13 + e.Message;
      end;
    end;end.
    报错信息:
    Access violation at address 00c65e59. write of address 00c65e59. 
      

  3.   

    ‘我的电脑’-> ‘属性'->'高级'->'性能'->'数据保护' 里面添加你的应用程序就可以了