hmm .. ich denke es liegt daran ...
Delphi-Quellcode:
if @FGetColCaption<>
nil then
Result:=FGetColCaption(ColName,Spezial);
FreeLibrary(
Handle);
Du bekommst einen Pointer auf eine Zeichenkette und speicherst den in Result.
Wenn du jetzt FreeLibrary aufruft wird der Pointer Zerstört und du bekommst nur noch Müll!
probiers mal so:
Delphi-Quellcode:
function GetColCaption(ColName, Spezial: PChar):
string;
type
TGetColCaption =
function(ColName, Spezial: PChar): PChar;
var
FGetColCaption : TGetColCaption;
Handle : THandle;
begin
Handle := LoadLibrary(PChar('
../TurnFkt'));
if Handle <> 0
then
begin
@FGetColCaption := GetProcAddress(
Handle, '
GetColCaption');
if @FGetColCaption <>
nil then
Result := FGetColCaption(ColName, Spezial)^;
FreeLibrary(
Handle);
end;
end;