void f(cli::array<PointF> ^points){
PointF& a = points[0];
// and so on...
}
編譯錯誤在第2行C++/CLI參考變
.\ndPanel.cpp(52) : error C2440: 'initializing' : cannot convert from 'System::Drawing::PointF' to 'System::Drawing::PointF &'
An object from the gc heap (element of a managed array) cannot be converted to a native reference
什麼是聲明一個參考變量的管理方法是什麼?
gcroot只是一個快捷方式的GCHandle,而不是本身的參考。它用於通過將託管對象固定在託管堆中來使本機類指向並使用託管對象。 – 2008-10-29 13:21:33