Tuesday, June 15, 2004

Web App Debugger

A paper I'd written for Borcon 2002 is finally ready on my company's web site. It's about how to use the Web App Debugger in Delphi. Read more at http://www.agnisoft.com/white_papers/wad/default.asp.

(And I finally updated the phone numbers on the Contact page)

3 Comments:

Blogger Lachlan said...

Just curious if you've encountered and found a work around for this problem with the WAD.

http://qc.borland.com/wc/wc.exe/details?ReportID=7738

3:28 AM  
Blogger Deepak Shenoy said...

Ok, that problem really sucks. The problem is that a lot of the Delphi code actually depends on the prog id being part of the path info. Here's the fix:

Copy "SockHTTP" from the Delphi Source\Internet folder into your project folder, and most importantly, Add it to your project. Then, change the TSockWebRequest.GetStringVariable to:

function TSockWebRequest.GetStringVariable(Index: Integer): string;
var iPos : integer;
begin
Result := FIntf.GetStringVariable(Index);
if Index=4 then // pathinfo
begin
result := Copy(Result, 2, Length(Result));
iPos := Pos('/', Result);
if iPos>0 then
Result := Copy(Result, iPos, Length(Result))
else
Result := '/';
end;
end;

Also change TSockWebRequest.GetInternalPathInfo to: (You'll need to comment out a few lines)

function TSockWebRequest.GetInternalPathInfo: string;
var
P: Integer;
begin
if UsingStub then
begin
Result := PathInfo;
Assert(Length(Result) > 0, 'Unexpected length');
(* COMMENTED BY DEEPAK

Assert(Result[1] = '/', 'Unexpected value');
Delete(Result, 1, 1);
// Remove first section of path. This is a reference
// to the progid.
P := Pos('/', Result); {do not localize}
if P > 0 then
Delete(Result, 1, P-1)
else
Result := '/';

END COMMENTED BY DEEPAK *)
end
else
Result := inherited GetInternalPathInfo;
end;

5:07 AM  
Blogger Deepak Shenoy said...

Er. This commenting thing isn't as good as I thought. So I added it to the blog. Click Here.

5:16 AM  

Post a Comment

<< Home