Jump to content
Sign in to follow this  
dormky

How can I cast a Pointer to any pointer type

Recommended Posts

I'm trying to use TValue.Make with a pointer. Unfortunately, "myPointer as PByte" is apparently not valid Delphi code (E2015 Operator not applicable to this operand type). "myPointer as Integer" and "myPointer" alone aren't valid either.

How can I tell Delphi to treat my pointer as just a number ? Basically, I need to do pointer arithmetic so as to give the correct address to TValue.Make.

Share this post


Link to post

NativeUInt(Pointer) doesn't work. "NativeUInt(myPointer)" doesn't give the same number as "PByte(myRecord)", despite "myPointer" being the same value as "@myRecord".

 

Strangely, "PNativeUInt(myRecord)" isn't valid but "PByte(myRecord)" is, wtf ?

Edited by dormky

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×