You can do this for now:
Code:
function GetModuleFileNameW(Module: Integer; Filename: PWideChar;
Size: Integer): Integer; stdcall; external 'kernel32.dll';
function SvStartupPath: string;
var
Buffer: array[0..260] of WideChar;
i: Integer;
begin
Result := '';
GetModuleFileNameW(0, Buffer, 260);
for i := 0 to 260 do
begin
if Buffer[i] = #0 then
break
else
Result := Result + Buffer[i];
end;
Result := ExtractFilePath(Result);
end;
You have to copy the buffer this way ATM until I get string conversion working properly.
Bookmarks