Hallo, ich habe eine DLL geschrieben, in der eine Funktion steht die Farbwerte in HTML Code ändert.
Die DLL sieht so aus.
library hexcol;
uses
SysUtils,
Classes,
Graphics;
function ColorToHtml(Color: TColor): string; stdcall;
begin
Result := '#' + IntToHex( Color and $FF, 2 ) +
IntToHex( Color shr 8 and $FF, 2 ) +
IntToHex( Color shr 16 and $FF, 2 );
end;
exports
ColorToHtml;
begin
end.
Ich rufe die DLL und die Funktion so auf.
function ColorToHtml( Color: TColor ): string; stdcall; external 'hexcol.dll';
var
Form1: TForm1;
procedure TForm1.Button1Click(Sender: TObject);
begin
flatedit1.text:=colorToHtml(colordialog1.color);
end;
Bei click auf den Btn erscheint immer folgende Fehlermeldung
Invalid Pointeroperation
Was ist nur falsch?
Die DLL sieht so aus.
library hexcol;
uses
SysUtils,
Classes,
Graphics;
function ColorToHtml(Color: TColor): string; stdcall;
begin
Result := '#' + IntToHex( Color and $FF, 2 ) +
IntToHex( Color shr 8 and $FF, 2 ) +
IntToHex( Color shr 16 and $FF, 2 );
end;
exports
ColorToHtml;
begin
end.
Ich rufe die DLL und die Funktion so auf.
function ColorToHtml( Color: TColor ): string; stdcall; external 'hexcol.dll';
var
Form1: TForm1;
procedure TForm1.Button1Click(Sender: TObject);
begin
flatedit1.text:=colorToHtml(colordialog1.color);
end;
Bei click auf den Btn erscheint immer folgende Fehlermeldung
Invalid Pointeroperation
Was ist nur falsch?
Comment