webbrokerの動作とだバッグ方法について


螺子  2016-01-21 22:51:36  No: 47923

Delphi10Pro+Win7Pro/WindowsSever2012R2+XAMPP5.5.24 です。

webbrokerというものを(今頃)知ったのでApache(XAMPP)で動作させようと考えています。がデバッグの仕方がよくわかりません。

(再現手順)

新規プロジェクト
→Webサーバアプリケーション
→Apacheダイナミックモジュール
→VCLアプリケーション
→Apacheバージョン2.4(ここがダメなのかも)
→完了

Actionに項目を2つ追加
→  WebActionItem1  の PathInfo に "/test” をセット
→  WebActionItem2  の PathInfo に "/size” をセット

コンパイルオプションの出力ディレクトリを
C:\xampp\apache\modules\
に。

実行時引数で
  ホストアプリケーションに
  C:\Program Files\Internet Explorer\iexplore.exe

  パラメータに
  http://localhost/webbrokertest

をセット。

httpd.conf の最後に下記を追加。

LoadModule webbroker_module modules/mod_webbroker.dll
<Location /webbrokertest>
  SetHandler mod_webbroker-handler
</Location> 

イベントを下記に書き換え。Apacheを停止させてコンパイル&実行し、すかさずapacheを再起動
させると、IEが立ち上がり、Web サーバー アプリケーション  と表示される。
アドレスを http://localhost/webbrokertest/size  にすると cドライブの空き容量が表示さされる。

ここまではOKです「が」、デバッグの仕方がわかりません。
ブレークポイントで止まりません。
「DelphiプログラマのためのCGI入門(1999)」を読むとデバッグできるように書いてあるのですが。。。

何がまずいのでしょうか?教えてください。

procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject; Request: TWebRequest; Response: TWebResponse;
  var Handled: Boolean);
var
  I: Integer;
begin

  Response.ContentType := 'text/html';
  Response.Content := '<H1>Hello World-1</H1>';

  if Request.Method = 'GET' then
    Response.Content := Response.Content + '<B>GET</B> ' + '<BR> Query : ' + Request.Query
  else if Request.Method = 'POST' then
    Response.Content := Response.Content + '<B>POST</B>' + '<BR> Content: ' + Request.Content;

  Response.Content := Response.Content + '<br>' + inttostr(Request.QueryFields.Count) + '<br>';

  for I := 0 to Request.QueryFields.Count - 1 do
  begin
    Response.Content := Response.Content + Request.QueryFields[I] + '<br>';
  end;

end;

procedure TWebModule1.WebModule1WebActionItem2Action(Sender: TObject; Request: TWebRequest; Response: TWebResponse;
  var Handled: Boolean);
var
  iDiskFree: Int64;
  drvno: Integer;
  gb1: double;
begin

  drvno := ord('C') - $40;
  iDiskFree := DiskFree(drvno);
  gb1 := iDiskFree / (1024 * 1024 * 1024);

  Response.ContentType := 'text/html';
  Response.Content := '<H1>Hello World-2</H1>';
  Response.Content := '<br>' +Response.Content + Format('%6.2f GB', [gb1]);

end;


螺子  2016-01-22 00:19:11  No: 47924

×だバッグ
○デバッグ

です。


※返信する前に利用規約をご確認ください。

※Google reCAPTCHA認証からCloudflare Turnstile認証へ変更しました。






  このエントリーをはてなブックマークに追加