I can’t install a previous custom comonent made with Raize components

Home Forums Konopka Signature VCL Controls (formerly Raize Components) I can’t install a previous custom comonent made with Raize components

Viewing 3 reply threads
  • Author
    Posts
    • #2610
      Larry Dew
      Participant

        I created this component many years ago and have been able to successfully re-compile it with a package that installed. I am trying to install it into 10.4.2 and I get the error:

        Can’t load package C:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl\Package1.bpl.

        The specific module could not be found.

        It appears the the “Requires” RaiseComponentVcl.dcp is the problem?

         

        unit IPEdit;
        
        interface
        
        uses
        Windows, System.SysUtils, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
        Vcl.StdCtrls, Vcl.ExtCtrls, RzPanel, RzEdit, RzCommon;
        
        const
        BS = #8;
        
        type
        TIPEdit = class;
        
        TIPByteEditor = class(TRzEdit)
        private
        protected
        published
        ParentPanel: TIPEdit;
        constructor Create(AOwner: TComponent); override;
        end;
        
        TIPEdit = class(RzPanel.TRzCustomPanel)
        private
        MyEnabled: Boolean;
        MyChange: TNotifyEvent;
        MyEnter: TNotifyEvent;
        procedure PanelEnter(Sender: TObject);
        procedure MyResize(Sender: TObject);
        procedure PanelClick(Sender: TObject);
        procedure PanelDblClick(Sender: TObject);
        procedure FilterKey(Sender: TObject; var Key: Char);
        procedure ExitByteEdit(Sender: TObject);
        procedure EditClick(Sender: TObject);
        procedure EditChange(Sender: TObject);
        function GetText: String;
        procedure SetText(Value: String);
        function GetValue: integer;
        procedure SetValue(Value: integer);
        procedure Set_Enabled(Yes: Boolean);
        function GetOctet_1: integer;
        function GetOctet_2: integer;
        function GetOctet_3: integer;
        function GetOctet_4: integer;
        protected
        IPByteEditors: Array[0..3] of TIPByteEditor;
        Dots: Array[0..2] of TLabel;
        procedure SetFrameController( Value: TRzFrameController ); override;
        public
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
        procedure Loaded; override;
        function Focused: boolean; override;
        property Octet_1 : integer read GetOctet_1;
        property Octet_2 : integer read GetOctet_2;
        property Octet_3 : integer read GetOctet_3;
        property Octet_4 : integer read GetOctet_4;
        published
        property Ctl3D stored True;
        property Font;
        property Text: String read GetText write SetText stored True;
        property Value: integer read GetValue write SetValue stored True;
        property Visible;
        property Anchors;
        property BorderStyle;
        property Color;
        property ShowHint;
        property Enabled: boolean read MyEnabled write Set_Enabled;
        property OnChange: TNotifyEvent read MyChange write MyChange;
        property OnClick;
        property OnDblClick;
        property OnEnter: TNotifyEvent read MyEnter write MyEnter;
        property OnExit;
        property TabOrder;
        property TabStop;
        property FrameController;
        end;
        
        procedure Register;
        
        implementation
        
        procedure Register;
        begin
        RegisterComponents('RDSoft', [TIPEdit]);
        end;
        
        (******************************************************************************
        **
        ** TIPEdit
        **
        ******************************************************************************)
        
        constructor TIpEdit.Create(AOwner: TComponent);
        var
        n: integer;
        begin
        inherited Create(AOwner);
        inherited Enabled := True;
        inherited OnEnter := PanelEnter;
        OnEnter := nil;
        OnChange := nil;
        MyEnabled := True;
        Caption := '';
        Height := 21;
        Width := 130;
        BevelInner := bvNone;
        BevelOuter := bvNone;
        BorderStyle := bsNone;
        BorderOuter := fsNone;
        OnResize := MyResize;
        Color := clWindow;
        for n := 0 to 3 do
        begin
        IPByteEditors[n] := TIPByteEditor.Create(Self);
        IPByteEditors[n].Parent := Self;
        IPByteEditors[n].Tag := n;
        IPByteEditors[n].MaxLength := 3;
        IPByteEditors[n].OnKeyPress := FilterKey;
        IPByteEditors[n].OnExit := ExitByteEdit;
        IPByteEditors[n].OnClick := EditClick;
        IPByteEditors[n].OnDblClick := PanelDblClick;
        IPByteEditors[n].ParentColor := True;
        IPByteEditors[n].ParentFont := True;
        IPByteEditors[n].ParentShowHint := True;
        IPByteEditors[n].OnChange := EditChange;
        end;
        for n := 0 to 2 do
        begin
        Dots[n] := TLabel.Create(Self);
        Dots[n].Parent := Self;
        Dots[n].ParentColor := True;
        Dots[n].ParentFont := True;
        Dots[n].Font.Style := [fsBold];
        Dots[n].ParentShowHint := True;
        Dots[n].OnClick := PanelClick;
        Dots[n].OnDblClick := PanelDblClick;
        Dots[n].Caption := '.';
        Dots[n].AutoSize := True;
        Dots[n].Alignment := taCenter;
        end;
        end;
        
        destructor TIpEdit.Destroy;
        var
        n: integer;
        begin
        for n := 0 to 3 do
        IPByteEditors[n].Free;
        for n := 0 to 2 do
        Dots[n].Free;
        Inherited Destroy;
        end;
        
        procedure TIPEdit.Loaded;
        begin
        inherited loaded;
        MyResize(Self);
        end;
        
        procedure TIPEdit.PanelEnter(Sender: TObject);
        begin
        IPByteEditors[0].SetFocus;
        if assigned(OnEnter) then
        OnEnter(Self);
        end;
        
        procedure TIPEdit.EditClick(Sender: TObject);
        begin
        if assigned(inherited OnClick)
        then OnClick(Self);
        end;
        
        procedure TIPEdit.EditChange(Sender: TObject);
        begin
        if assigned(OnChange) then
        OnChange(Self);
        end;
        
        procedure TIPEdit.PanelClick(Sender: TObject);
        begin
        if assigned(Inherited OnClick) then
        OnClick(Self);
        end;
        
        procedure TIPEdit.PanelDblClick(Sender: TObject);
        begin
        if assigned(Inherited OnDblClick) then
        OnDblClick(Self);
        end;
        
        procedure TIPEdit.FilterKey(Sender: TObject; var Key: Char);
        var
        Next: integer;
        Txt : string;
        begin
        if Sender is TIPByteEditor then
        begin
        Next := TIPByteEditor(Sender).Tag+1;
        case Key of
        '.': begin
        key := #0;
        if Next < 4 then
        IPByteEditors[Next].SetFocus;
        end;
        '0'..'9': begin
        Txt := TIPByteEditor(Sender).Text + Key;
        if (Length(Txt) = 3) and (Next < 4) then begin if StrToIntDef(Txt,0) > 255 then
        Beep
        else
        IPByteEditors[Next].SetFocus;
        end;
        end;
        BS: Key := Key
        else
        key := #0;
        end;
        end;
        end;
        
        procedure TIPEdit.Set_Enabled(Yes: Boolean);
        var
        n: integer;
        begin
        MyEnabled := Yes;
        for n := 0 to 3 do
        IPByteEditors[n].Enabled := Yes;
        Color := IPByteEditors[0].Color;
        inherited Enabled := Yes;
        for n := 0 to 2 do
        Dots[n].Enabled := Yes;
        end;
        
        procedure TIPEdit.ExitByteEdit(Sender: TObject);
        var
        Num : integer;
        begin
        if Sender is TIPByteEditor then
        begin
        Num := StrToIntDef(TIPByteEditor(Sender).Text,0);
        if Num > 255 then
        begin
        TIPByteEditor(Sender).Text := '255';
        Beep;
        end;
        end;
        end;
        
        function TIPEdit.GetText: String;
        begin
        Result := Concat(IPByteEditors[0].Text, '.',
        IPByteEditors[1].Text, '.',
        IPByteEditors[2].Text, '.',
        IPByteEditors[3].Text);
        end;
        
        Procedure TIPEdit.SetText(Value: String);
        var
        p: integer;
        n: integer;
        
        function mod256(sByte: String): string;
        var
        i, x: integer;
        begin
        Val(sByte, i, x);
        Result := format('%d',[i Mod 256]);
        end;
        
        begin
        Value := Trim(Value) + '.';
        p := pos('.', Value);
        n := 0;
        while p > 0 do
        begin
        IPByteEditors[n].Text := mod256(Copy(Value, 1, p-1));
        Inc(n);
        if n > 3 then
        exit;
        Value := Copy(Value, p+1, length(Value) - p);
        p := pos('.', Value);
        end;
        end;
        
        function TIPEdit.GetValue: integer;
        begin
        Result := (StrToIntDef(IPByteEditors[0].Text,0) shl 24) or
        (StrToIntDef(IPByteEditors[1].Text,0) shl 16) or
        (StrToIntDef(IPByteEditors[2].Text,0) shl 8) or
        StrToIntDef(IPByteEditors[3].Text,0);
        end;
        
        procedure TIPEdit.SetValue(Value: integer);
        var
        n: integer;
        begin
        for n := 3 downto 0 do
        begin
        IPByteEditors[n].Text := IntToStr(Value and $FF);
        Value := Value shr 8;
        end;
        end;
        
        procedure TIPEdit.MyResize(Sender: TObject);
        var
        n: integer;
        dw: integer;
        ew: integer;
        TotWidth: integer;
        ewMin: integer;
        hMin: integer;
        Bw : integer;
        begin
        Bw := BorderWidth * 2;
        ewMin := Dots[0].Canvas.TextWidth('000');
        hMin := Dots[0].Canvas.TextHeight('0');
        dw := Dots[0].Width;
        ew := (Width - Bw - dw - dw - dw) div 4;
        if ew < ewMin then
        ew := ewMin;
        TotWidth := ew + ew + ew + ew + dw + dw + dw + Bw;
        if Height < (hMin + Bw) then
        begin
        Height := hMin + Bw;
        end
        else
        if Width < TotWidth then
        begin
        Width := TotWidth;
        end
        else
        begin
        for n := 0 to 3 do
        begin
        IPByteEditors[n].Width := ew-4;
        IPByteEditors[n].Height := hMin;
        IPByteEditors[n].Left := n * (ew + dw)+2;
        IPByteEditors[n].Top := (ClientHeight - hMin) div 2;
        end;
        for n := 0 to 2 do
        begin
        Dots[n].Height := IPByteEditors[0].Height;
        Dots[n].Top := IPByteEditors[0].Top;
        Dots[n].Left := ew + n * (ew + dw);
        end;
        end;
        end;
        
        function TIPEdit.GetOctet_1: integer;
        begin
        Result := StrToIntDef(IPByteEditors[3].Text,0);
        end;
        
        function TIPEdit.GetOctet_2: integer;
        begin
        Result := StrToIntDef(IPByteEditors[2].Text,0);
        end;
        
        function TIPEdit.GetOctet_3: integer;
        begin
        Result := StrToIntDef(IPByteEditors[1].Text,0);
        end;
        
        function TIPEdit.GetOctet_4: integer;
        begin
        Result := StrToIntDef(IPByteEditors[0].Text,0);
        end;
        
        function TIPEdit.Focused: boolean;
        begin
        Focused := IPByteEditors[0].Focused or IPByteEditors[1].Focused or IPByteEditors[2].Focused or IPByteEditors[3].Focused;
        end;
        
        procedure TIPEdit.SetFrameController(Value: TRzFrameController);
        begin
        if Assigned( Value ) then
        BorderStyle := bsNone
        else
        begin
        BorderOuter := fsNone;
        BorderStyle := bsSingle;
        end;
        inherited;
        end;
        
        (******************************************************************************
        **
        ** TIPByteEditor
        **
        ******************************************************************************)
        constructor TIPByteEditor.Create(AOwner: TComponent);
        begin
        inherited Create(AOwner);
        BorderStyle := bsNone;
        Text := '0';
        Alignment := taRightJustify;
        end;
        
        end.
      • #2617
        Ray Konopka
        Keymaster

          Hi Larry,

          From the information that you provided, the Package1.bpl appears to be referencing the RaizeComponentsVcl runtime package in the requires sections of Package1.dpk source file. BTW, I would strongly recommend changing the name of your package to something more useful.

          When Delphi tries to load Package1.bpl (the compiled package), the Windows loader will try to also load any dependent runtime packages. For example, vcl270.bpl and rtl270.bpl, as well as any other runtime packages that the package requires.

          What I am not so clear on is what version of Delphi you used to build the package? You stated that you were able to compile your package and it installed, but you are getting an error when you try to install it into 10.4. Compiled package files (i.e. *.bpl files) are not compatible between versions of Delphi. You will need to compile your custom package using 10.4.

          But as I said, I’m not too clear on just what is happening from what you posted. Another thing to check is to make sure that the KSVC Lib\RX10.4\Win32 directory is listed in your Delphi search path. Delphi will need this path in order to locate the RaizeComponentsVcl.dcp file.

          Ray

        • #2627
          Larry Dew
          Participant

            Thanks you for your response. The name Package1 is just a test, the real package contains several other components and named appropriately, but it was this one that seemed to cause the problem. I started with a new package, added only the unit IPEdit and built it. The compiler added the RaiseComponentsVcl.dcp and a couple other required files. The build had no errors or warnings. When I tried to “Install” the package is when I received the error dialog. This is a brand new install of 10.4.2 and  would hope all of my paths are correct. I will check to see that KSVC Lib\RX10.4\Win32 is in the search path. As a test I changed the “Rz”  components to standard vcl components and it built and installed without issues.

            Thanks again for your time. I have been a Raize user for a very long time.

          • #2633
            Ray Konopka
            Keymaster

              What is the precise error message that is being displayed? A screenshot may be helpful.

              Also, how are you trying to install the package? Are you right-clicking on the package and selecting install? Or, are you using the Component > Install Packages dialog box?

              What does the Package1.dpk look like?

              Ray

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.