How to get the pointer of "this" ?

ag0aep6g anonymous at example.com
Tue May 26 13:48:52 UTC 2020


On 26.05.20 15:43, Vinod K Chandran wrote:
> So far now, two solutions are very clear for this problem.
> 1. As per John Chapman's suggestion - use cast(DWORD_PTR)cast(void*)this).
> 2. Use another varibale to use as an lvalue. -
>       Button dummyBtn = this;
>       cast(DWORD_PTR)&dummyBtn;
> Among these two, i think 2nd option is good. Am i right ?

No. Use option 1.


More information about the Digitalmars-d-learn mailing list