AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Resourcestring laden

Ein Thema von Neutral General · begonnen am 15. Mär 2008 · letzter Beitrag vom 18. Mär 2008
 
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#13

Re: Resourcestring laden

  Alt 15. Mär 2008, 18:26
Hi^^

Also

eine Unit:

Delphi-Quellcode:
unit Unit1;

interface

uses NVCLForms;

type
  TForm1 = class(TNVCLForm)
    procedure FormCreate(Sender: TObject);
  private

  public

  end;

{$R FormCreate.res}

implementation

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
// Code
end;

end.
andere Unit:

Delphi-Quellcode:
unit NVCLForms;

//...

constructor TNVCLForm.Create(AParent: TNVCLControl);
var resStr: String;
begin
  // resourcestring laden
  // bisher so:
  SetLength(resStr,High(Byte));
  LoadString(hInstance,0,@resStr[1],255); // String wird geladen, geht aber nur mit .res datei
  Trim(resStr);
end;

// ...

end.
Und weil das wie gesagt mit ner .rc/.res Datei zu nervig ist wollte ichs so machen:

Delphi-Quellcode:
unit Unit1;

interface

uses NVCLForms;

type
  TForm1 = class(TNVCLForm)
    procedure FormCreate(Sender: TObject);
  private

  public

  end;

resourcestring
  FormCreate = 'FormCreate';

implementation

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
// Code
end;

end.
Delphi-Quellcode:
unit NVCLForms;

//...

constructor TNVCLForm.Create(AParent: TNVCLControl);
var resStr: String;
begin
  // resourcestring laden
  -->???????<--
end;

// ...

end.
Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:51 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz