直接从TComponent继承的,包安装成功,但找不到组件,包属性是设计与运行时的
谁碰到过没?

解决方案 »

  1.   

    procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('页名', [组件名]);
    //  RegisterComponents('Samples', [TMyControl]);
    end;
      

  2.   

    我是选的现成Internet页,要自定义的吗?
    RegisterComponents('Internet', [TMyClient]);
      

  3.   

    正解:procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('页面名', [组件名]);
    // RegisterComponents('Samples', [TMyControl]);
    end;
      

  4.   

    procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('Internet', [TMyClientSocket]);
    end;-------------
    package MyClientSocket;{$R *.res}
    {$ALIGN 8}
    {$ASSERTIONS ON}
    {$BOOLEVAL OFF}
    {$DEBUGINFO ON}
    {$EXTENDEDSYNTAX ON}
    {$IMPORTEDDATA ON}
    {$IOCHECKS ON}
    {$LOCALSYMBOLS ON}
    {$LONGSTRINGS ON}
    {$OPENSTRINGS ON}
    {$OPTIMIZATION ON}
    {$OVERFLOWCHECKS OFF}
    {$RANGECHECKS OFF}
    {$REFERENCEINFO ON}
    {$SAFEDIVIDE OFF}
    {$STACKFRAMES OFF}
    {$TYPEDADDRESS OFF}
    {$VARSTRINGCHECKS ON}
    {$WRITEABLECONST OFF}
    {$MINENUMSIZE 1}
    {$IMAGEBASE $400000}
    {$DESCRIPTION 'MyClientSocket'}
    {$IMPLICITBUILD OFF}requires
      rtl;contains
      uClientSocket in 'uClientSocket.pas',
      uPublicFun in '..\public\uPublicFun.pas';end.
      

  5.   

    unit uXdwButton;interfaceuses
      SysUtils, Classes,StdCtrls;type
      TXdwButton = class(TButton)
      private
        FStr: string;
        procedure SetStr(const Value: string);
        { Private declarations }
      protected
        { Protected declarations }
      public
        { Public declarations }
      published
        { Published declarations }
        property Str:string read FStr write SetStr;
      end;procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('Samples', [TXdwButton]);
    end;{ TXdwButton }procedure TXdwButton.SetStr(const Value: string);
    begin
      FStr := Value;
    end;end.
    procedure Register;
    begin
      RegisterComponents('Internet', [TMyClientSocket]);
    end;
    写到'uClientSocket.pas'里面去吧!
      

  6.   

    我的主单元文件是unit MyClientSocket;interfaceuses
      SysUtils,
      Classes,
      uPublicFun,
      uClientSocket;type
      TSocketMsgEvent = procedure(Sender: TObject; const ASocketMsg: string) of object;  TJcClientSocket = class(TComponent)
      private
        { Private declarations }
        FClientSocketThread: TClientSocketThread;
        FOnSocketMsg: TSocketMsgEvent;    function GetRemoteIp: string;
        function GetRemotePort: Integer;
        function GetHeartbeatMS: Cardinal;
        function GetOnErrorNotify: TErrorNotifyEvent;
        function GetOnInfoNotify: TInfoNotifyEvent;    procedure SetRemoteIp(const Value: string);
        procedure SetRemotePort(const Value: Integer);
        procedure SetHeartbeatMS(const Value: Cardinal);
        procedure SetOnSocketMsg(const Value: TSocketMsgEvent);
        procedure SetOnErrorNotify(const Value: TErrorNotifyEvent);
        procedure SetOnInfoNotify(const Value: TInfoNotifyEvent);    procedure DealSocketMsg(lSocketMsg: string);
      protected
        { Protected declarations }
        procedure DoOnSocketMsg(const ASocketMsg: string);
      public
        { Public declarations }
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
        function MySendString(AData: AnsiString): Boolean;
      published
        { Published declarations }
        property RemoteIp: string read GetRemoteIp write SetRemoteIp;
        property RemotePort: Integer read GetRemotePort write SetRemotePort default 5000;
        property HeartbeatMS: Cardinal read GetHeartbeatMS write SetHeartbeatMS default 30000;    property OnSocketMsg: TSocketMsgEvent read FOnSocketMsg write SetOnSocketMsg;
        property OnErrorNotify: TErrorNotifyEvent read GetOnErrorNotify write SetOnErrorNotify;
        property OnInfoNotify: TInfoNotifyEvent read GetOnInfoNotify write SetOnInfoNotify;
      end;procedure Register;implementationprocedure Register;
    begin
      RegisterComponents('Internet', [TMyClientSocket]);
    end;{ TMyClientSocket }
    ...uClientSocket.pas只是实现线程类TClientSocketThread的单元啊
    要把Register放uClientSocket.pas?
      

  7.   

    我在包的代码文件MyClientSocket.dpk中没找到对组件主单元文件MyClientSocket的引用,这是不是问题?