Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: Вывод кода VCL и открытых методов класса
Форум программистов > Системное программирование > Delphi и Pascal > Delphi - Система
tenebrise
нужно в один листбокс вывести текст из библиотеки Vcl, а затем в другой лист бокс вывести имя методов
с атрибутом доступа public заданного класса, но чёто там не работает
Код
procedure TForm1.Button2Click(Sender: TObject);
  var
   i,j:integer;
   s,name:string;
begin
   for i:=0 to ListBox1.count - 1 do
   begin
    name:=edit1.text+' = class(T';
    if (pos(name,ListBox1.Items[i])>0)  then
       begin
       j:=i;
       repeat
         inc(j);
       until (pos('public',ListBox1.Items[j])>0) or (pos('end',ListBox1.Items[j])>0);
       repeat
         inc(j);
         if (pos('procedure',ListBox1.Items[j])>0) then
          begin
           s:=(copy(trim(ListBox1.Items[j]),11,pos('(',ListBox1.Items[j])));
           s:=s+' procedure';

           ListBox2.Items.Add(s);
          end
           else
            if (pos('function',ListBox1.Items[j])>0) then
          begin
           s:=(copy(ListBox1.Items[j],14,pos('(',ListBox1.Items[j])));
           ListBox2.Items.Add(s);
            end
            else
             if (pos('constructor',ListBox1.Items[j])>0) then
          begin
           s:=(copy(ListBox1.Items[j],17,pos('(',ListBox1.Items[j])));
           ListBox2.Items.Add(s);
            end
            else
             if (pos('destructor',ListBox1.Items[j])>0) then
          begin
           s:=(copy(ListBox1.Items[j],16,pos('(',ListBox1.Items[j])));
           ListBox2.Items.Add(s);


            end
         else

       until (pos('private',ListBox1.Items[j])>0) or
       (pos('published',ListBox1.Items[j])>0) or
       (pos('protected',ListBox1.Items[j])>0) or
       (pos('end',ListBox1.Items[j])>0 );
      end;
    end;
end;

а выводится имя методов и еще несколько символов после, хотя я поставмил условие копировать до скобочки
sax_ol
Каков формат строк (всмысле покажите их) в ListBox1?
tenebrise
CODE
type
TOleStream = class(TStream)
private
FStream: IStream;
protected
function GetIStream: IStream;
public
constructor Create(const Stream: IStream);
function Read(var Buffer; Count: Longint): Longint; override;
function Write(const Buffer; Count: Longint): Longint; override;
function Seek(Offset: Longint; Origin: Word): Longint; override;
end;

TConnectionPoints = class;

TConnectionKind = (ckSingle, ckMulti);
{$EXTERNALSYM TConnectionKind}

TConnectionPoint = class(TContainedObject, IConnectionPoint)
private
FContainer: TConnectionPoints;
FIID: TGUID;
FSinkList: TList;
FOnConnect: TConnectEvent;
FKind: TConnectionKind;
function AddSink(const Sink: IUnknown): Integer;
procedure RemoveSink(Cookie: Longint);
protected
{ IConnectionPoint }
function GetConnectionInterface(out iid: TIID): HResult; stdcall;
function GetConnectionPointContainer(
out cpc: IConnectionPointContainer): HResult; stdcall;
function Advise(const unkSink: IUnknown; out dwCookie: Longint): HResult; stdcall;
function Unadvise(dwCookie: Longint): HResult; stdcall;
function EnumConnections(out enumconn: IEnumConnections): HResult; stdcall;
public
constructor Create(Container: TConnectionPoints;
const IID: TGUID; Kind: TConnectionKind; OnConnect: TConnectEvent);
property SinkList : TList read FSinkList;
destructor Destroy; override;
end;
{$EXTERNALSYM TConnectionPoint}

TConnectionPoints = class{IConnectionPointContainer}
private
FController: Pointer; // weak ref to controller - don't keep it alive
FConnectionPoints: TList;
function GetController: IUnknown;
protected
{ IConnectionPointContainer }
function EnumConnectionPoints(
out enumconn: IEnumConnectionPoints): HResult; stdcall;
function FindConnectionPoint(const iid: TIID;
out cp: IConnectionPoint): HResult; stdcall;
public
constructor Create(const AController: IUnknown);
destructor Destroy; override;
function CreateConnectionPoint(const IID: TGUID; Kind: TConnectionKind;
OnConnect: TConnectEvent): TConnectionPoint;
property Controller: IUnknown read GetController;
end;
sax_ol
tenebrise
И? "Что это было?" ©
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Русская версия IP.Board © 2001-2008 IPS, Inc.