服务器程序
unit mainimp1;
interface
uses
Windows, Messages, SysUtils, Classes, ComServ, ComObj, VCLCom, DataBkr,
DBClient, countryserver1_TLB, StdVcl, Provider, DBTables, Db;
type
Tcountryobject = class(TRemoteDataModule, Icountryobject)
countrytable: TTable;
Session1: TSession;
countryProvider: TDataSetProvider;
private
{ Private declarations }
protected
class procedure UpdateRegistry(Register: Boolean;
const ClassID, ProgID: string);
override;
public
{ Public declarations }
end;
implementation
{$R *.DFM}
class procedure Tcountryobject.UpdateRegistry(Register: Boolean;
const ClassID, ProgID: string);
begin
if Register then
begin
inherited UpdateRegistry(Register, ClassID, ProgID);
EnableSocketTransport(ClassID);
EnableWebTransport(ClassID);
end else
begin
DisableSocketTransport(ClassID);
DisableWebTransport(ClassID);
inherited UpdateRegistry(Register, ClassID, ProgID);
end;
end;
initialization
TComponentFactory.Create(ComServer, Tcountryobject,
Class_countryobject, ciMultiInstance, tmApartment);
end.
cgi程序
unit mainwebserver;
interface
uses
Windows, Messages, SysUtils, Classes, HTTPApp, CompProd, PagItems,
MidProd, XMLBrokr, Db, DBClient, MConnect, MidItems;
type
TWebModule1 = class(TWebModule)
DCOMConnection1: TDCOMConnection;
XMLBroker1: TXMLBroker;
MidasPageProducer1: TMidasPageProducer;
DataForm1: TDataForm;
FieldGroup1: TFieldGroup;
DataNavigator1: TDataNavigator;
private
{ Private declarations }
public
{ Public declarations }
end;
var
WebModule1: TWebModule1;
implementation
{$R *.DFM}
end.