Pointer to Form

Pointer to Form

BY 05 Sep 2013 Native Application Development

I have observed one interesting fact:

I have typical App with Frame and Form on it ( MyFrame Class inherited from Frame, MyForm Class inherited from Form)

Inside MyFrame Class I am able to get pointer to MyForm this way:
pForm1 =static_cast<Form*>(GetControl(L”IDF_FORM”));
but inside MyForm class I am unable to do this (returned adress is 0)

Could anybode explain me what the difference? Why it was allowed in one case but denied in another?

p.s. I have found how to get pointer to Form : just use ‘this’ enough, or
use …GetAppFrame()->GetFrame()->GetCurrentForm();

Thank you in advance.
Alexey.

Written by