Question about property & method access scope.
drug
drug2004 at bk.ru
Tue May 11 10:35:13 UTC 2021
11.05.2021 12:10, Vinod K Chandran пишет:
> Hi all,
> I am practising D with a win api GUI hobby project.
> I have a Window class and it resides in module window.d
> My WndProc function resides in another module named wnd_proc_module.d
> Inside my WndProc, I get the Window class like this.
> ```d
> Window win = cast(Window) (cast(void*) GetWindowLongPtrW(hWnd,
> GWLP_USERDATA)) ;
> ```
> So in many situations, I need to check some boolean properties of Window
> class and call some functions of Window class in WndProc.
> But I don't want to expose those props and functions to the user. So if
> I make them private, I can't access them inside the WndProc function.
> How do solve this issue. Thanks in advance.
Make them `protected`?
More information about the Digitalmars-d-learn
mailing list