在Delphi中取消引用和分配指针的语法

siw*_*mas 3 delphi pointers

需要实现一个接口指针传递的接口方法,并且需要取消引用指针并为其分配OleVariant.这是什么语法?

// Code I have no access to change
function GetEntry: string;
var
  value: OleVariant;
begin
  Entry(@value);  
  Result := VarToStr(value);
end;

// My code  
procedure Entry(Value: Pointer);
begin
  Value^ := ??? // Not sure whats the syntax here in order to assign an OleVariant
end
Run Code Online (Sandbox Code Playgroud)

Dav*_*nan 8

你可以使用这样的值:

OleVariant(Value^) := ...
Run Code Online (Sandbox Code Playgroud)

或者你可以施放指针:

POleVariant(Value)^ := ...
Run Code Online (Sandbox Code Playgroud)