3

Need to implement an interface method where a Pointer is passed and it is expected to dereference the Pointer and assign to it an OleVariant. Whats the syntax to do this?

// 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
0

1 Answer 1

9

You can use a value cast like this:

OleVariant(Value^) := ...

Alternatively you can cast the pointer:

POleVariant(Value)^ := ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.