Hi,
May I know how to declare a Class in C++ window application form? Below is my code and error as shown below as well.
here is my class declaration:
public ref class CLoadObj {
public:
bool ImportObj(t3DModel *pModel, char *strFileName);
System::Void ReadObjFile(t3DModel *pModel);
System::Void ReadVertexInfo(System::Void);
System::Void ReadFaceInfo(System::Void);
System::Void FillInObjectInfo(t3DModel *pModel);
System::Void ComputeNormals(t3DModel *pModel);
System::Void SetObjectMaterial(t3DModel *pModel, int whichObject, int materialID);
private:
FILE *m_FilePointer;
vector<CVector3> m_pVertices;
vector<tFace> m_pFaces;
vector<CVector2> m_pTextureCoords;
bool m_bObjectHasUV;
bool m_bJustReadAFace;
};
#endif
Below is my declaration a Class in window form application, and the error was stated as below:
CLoadObj^ g_LoadObj = gcnew CLoadObj;
error when debugging:
1>d:\fyp\a3203s\ver2of opengl_on_a_windows_form\opengl_on_a_windows_form\OpenGL.h(17) : error C3145: 'g_LoadObj' : global or static variable may not have managed type 'CLoadObj ^'
Im unable to link to the specify class by using the g_LoadObj.
Is there anyone can help? Thanks a lot...