我有一个对象:
namespace Picture{
class ref Picture{
System::String^ path
int picNumber;
};
}
然后我尝试制作一个数组并填充我path
的主要内容:
TrackPicOnSlide = 2;
array<Picture::Picture^>^ ArrayPics = gcnew array<Picture::Picture^>(TrackPicOnSlide);
ArrayPics[0]->path = "HI";
但它给了我一个运行时错误:
An unhandled exception of type 'System.NullReferenceException' occurred in PPTAuto.exe
Additional information: Object reference not set to an instance of an object.
我究竟做错了什么?