Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 May : Accessing a COM Object from Delphi ISAPI

www.cryer.info
Managed Newsgroup Archive

Accessing a COM Object from Delphi ISAPI

Subject:Accessing a COM Object from Delphi ISAPI
Posted by:"Steve" (steve@nospam.com)
Date:15 May 2007 01:13:15

I have a Delphi ISAPI DLL running under Windows 2003 SP 1 which connects through to a COM object and reports an error of "Access Denied".

It has worked in the past but never proven since SP1. I have followed all the steps I possibly can including changing the COM object so that no access checks are done.

I have an EXE which uses the COM object in the same way as the ISAPI and when I run that on the web server it works:

function TwmWeb.GetAddress(sPostCode: String): String;
var
  clsZapcode : ICoZapcodeClass         ;
  typAddress : IXMLICapscanAddressType ;
  xmlDoc     : TXMLDocument            ;
begin
  typAddress          := NewICapscanAddress                             ;
  typAddress.Postcode := sPostCode                                      ;
  clsZapcode          := CoCoZapcodeClass.CreateRemote(POSTCODE_SERVER) ;

  xmlDoc := TXMLDocument.Create(nil);
  xmlDoc.XML.Add(clsZapcode.LookupPostcode(typAddress.XML));
  typAddress := GetICapscanAddress(xmlDoc);
  if (typAddress.Result <> '0') then  Result := typAddress.ResText
  else Result := typAddress.Company  + sLineBreak +
                 typAddress.Address1 + sLineBreak +
                 typAddress.Address2 + sLineBreak +
                 typAddress.Address3 + sLineBreak +
                 typAddress.Address4 + sLineBreak +
                 typAddress.City     + sLineBreak +
                 typAddress.County   + sLineBreak +
                 typAddress.Postcode;

  Result := Trim(Result);
end;

Replies:

www.cryer.info
Managed Newsgroup Archive