2011-04-18 88 views
0

我保证我搜索的解决方案的高和低。你是我的最后一招。
我收到错误C3861错误(我真的尝试过)

错误6错误C3861: 'saveSessionLurch':标识符找不到420 1 cs482newUI

这里是我的XMLExport.h

#ifndef XMLEXPORT_H_ 
#define XMLEXPORT_H_ 

#include <vcclr.h> 
#include <string> 

using namespace std; 

    class XMLExport{ 
    public: 
     void saveSessionLurch(); 
     XMLExport(); 

    };//end class XMLExport 

#endif 

验证码是我的XMLExport.cpp代码:

#include "StdAfx.h" 
#include "XMLExport.h" 

void XMLExport::saveSessionLurch(){ 

}//end SaveSessionLurch 

这最终会做些什么,但我只是试图让它现在编译。

这里是Form1.h的代码。我实际上删除了大部分与此问题无关的代码。

这是代码的顶部:

#pragma once 
#include "Cell.h" 
#include "Session.h" 
#include "systemObjectWrapper.h" 
#include "XMLExport.h" 

,这是其中所述错误发生。该SaveFileDialog打开了,所以我知道了点击工作:

private: System::Void saveSessionButton_Click(System::Object^ sender,System::EventArgs^ e){ 
         SaveFileDialog^ saveFileDialog1 = gcnew SaveFileDialog; 
         saveFileDialog1->ShowDialog() 
        saveSessionLurch();//THIS IS WHERE THE ERROR IS 

       } 



非常感谢你提前为您的帮助。这将是很好的回报

回答

3

您需要致电saveSessionLurchXMLExport类的实例。

+0

我很尴尬......我不知道这意味着什么。你能扩展一下吗? – Luron 2011-04-18 17:54:47

+0

您需要学习基本的面向对象编程,关于类,方法和实例。 – SLaks 2011-04-18 17:58:32

+0

我知道这一切。我只是想确保我正确地理解你。你的意思是在form1.h中创建一个新的xmlExport实例,然后从该实例调用saveSessionLurch?如'this-> XMLExport = new XMLExport(); this-> XMLExport.saveSessionLurch();' – Luron 2011-04-18 18:05:17