Equivalent for "ref new MainPage()" in C++ Windows Runtime -
let's imagine, have application written on c++/cx. root namespace application namespace someapp{...}
. , have ref class mainpage{...}
in namespace. also, there ref class app{...}
, derived windows::ui::xaml::application
class. in method app::onlaunched(...)
instantiate instance of mainpage class code
auto somevariable = ref new mainpage();
what equivalent code in raw c++ application(without using c++/cx extension)?
tried replace
comptr<iinspectable> somevariable; auto classname = hstringreference(runtimeclass_someapp_mainpage).get(); roactivateinstance(classname, somevariable.getaddressof());
but call returns "regdb_e_classnotreg class not registered". think, c++/cx compiler replaces code with:
- direct call constructor of mainpage
- attempt find activation factory , after call activateinstance.
- some code
what option right?
Comments
Post a Comment