【发布时间】:2013-01-08 15:14:21
【问题描述】:
在 WindowsRT / Metro 中,如何将 ref ^ 指针转换为原始指针?
例如,我想将一个指向控件的指针传递给一个旧的 C 风格回调,它期望参数是 void*:
// this = type derived from Windows::UI::Xaml::Controls::Page
SetCallback(this);
但是,我得到一个错误:
无法将参数 1 从 'MyProject::MainPage ^const' 转换为 'void *'
如何将MainPage 转换为原始指针(没有 C 样式/reinterpret_casts)?
【问题讨论】:
标签: windows-8 microsoft-metro windows-runtime c++-cx