2013-04-14 26 views
0

我使用VS2010,C++窗體窗體應用程序。C++使你自己的類作爲字典的價值

這裏是我的類

#pragma once 
    public ref class FrameMatrix 
    { 
    public: 
     FrameMatrix(void); 
     FrameMatrix(int IdNm, int ClmnAmnt, int RwsAmnt); 
     String^ FMName; 
     int FMIdentificationNumber; 
     array<array<double>^>^ FMArray; 
    }; 

現在我試圖把它變成字典的價值。 而我得到未解決的令牌。

#pragma once 
#include "FrameMatrix.h" 
    public ref class Form1 : public System::Windows::Forms::Form 
    { 
    public: 
     Dictionary<int, FrameMatrix^>^ ImportedData; 
     Form1(void) 
     { 
      InitializeComponent(); 
      // 
      //TODO: Add the constructor code here 
      // 
      ImportedData = gcnew Dictionary<int, FrameMatrix^>; 
     } 

回答

0

你忘了括號:

ImportedData = gcnew Dictionary<int, FrameMatrix^>(); 
                ^^ 

如果不修正這個錯誤,請發表你得到確切的錯誤信息。