home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses
- ComObj, ActiveX, Pserver1_TLB,classes,dialogs;
-
- type
- Tcontrolusu = class(TAutoObject, Icontrolusu)
- protected
- function busqueda(const cadena: WideString): Integer; safecall;
- function sololectura(const cadena: WideString): Integer; safecall;
- {function sololectura(const cadena: WideString): Integer; safecall;}
- { Protected declarations }
- end;
- var
- Flista:TStringList;
- FAcceso:TStringList;
-
- implementation
-
- uses ComServ;
-
- function Tcontrolusu.busqueda(const cadena: WideString): Integer;
- begin
- if flista.indexof(cadena) <> -1 then
- result:=1
- else
- result:=0;
- end;
-
- function Tcontrolusu.sololectura(const cadena: WideString): Integer;
- begin
- result:=0;
- if facceso.indexof(cadena) <> -1 then
- result:=1
- end;
-
-
- initialization
- Flista:=TStringlist.create;
- flista.sorted:=True;
- //si tecleamos en la aplicaci≤n cliente cualquiera
- //de estos nombres no veremos el campo continent ni
- //el grßfico.
- flista.add('Pepe');
- flista.add('Luis');
- flista.add('Ana');
- facceso:=TStringList.create;
- facceso.sorted:=true;
- facceso.add('Antonio');
- TAutoObjectFactory.Create(ComServer, Tcontrolusu, Class_controlusu,
- ciMultiInstance, tmApartment);
- finalization
- flista.free;
- end.
-