2013-07-05 2 views
0

나는 오류 C4430 - 객체 - 클래스

class LCalculation 
{ 
    public: 
     unsigned __int64 m_Amount_of_Numbers; 
     [...] 
}; 

지금 내가 사용하고 이러한 오류에 직면하기 위해 노력하고있어, 다른 클래스에서 클래스 LCalculation의 객체를 만들었습니다. 그것은이 객체 선언과 관련이 있습니다. 나는 단지 그것을 얻지 않는다. 누구든지 이걸 도와 줄 수 있니? 더 많은 정보가 필요하면 언제든지 물어보십시오.



class CMFC_App_CalculationDlg : public CDialogEx 
{ 
private: 
    LCalculation m_LCalc; 
}; 

  • 1> C : 사용자 \ \ 관리 \ 문서 비주얼 스튜디오 2010 \ 프로젝트 \ \ 석회질 \ mfc_app_calculation \ mfc_app_calculationdlg.h (35) : 오류 C2146 : 구문 오류 : ';'이 없습니다. \ C : \ users \ admin \ documents \ Visual Studio 2010 \ projects \ Calc \ mfc_app_calculation \ mfc_app_calculationdlg.h (35) : C4430 : 유형 지정자가없는 것으로 가정합니다. 참고 : C++은 default-int
  • 을 지원하지 않습니다. 1> c : \ users \ admin \ documents \ visual 스튜디오 2010 \ projects \ Calc \ mfc_app_calculation \ mfc_app_calculationdlg.h (35) : 오류 C4430 : 유형 지정자가 없습니다. 참고 : \ 사용자 \ 관리자 \ 문서 비주얼 스튜디오 2010 \ 프로젝트 \ \ 석회질 \ mfc_app_calculation \ mfc_app_calculationdlg.cpp : C++ 기본-INT

void CMFC_App_Calculation::OnEnChangeEdit2() 
{ 
    m_LCalc.m_Amount_of_Numbers = UpdateData(TRUE); 
} 

  • 1> C 지원하지 않습니다 (191) : 오류 C2065 : 'm_LCalc': 선언되지 않은 식별자
  • 1> c : \ users \ admin \ documents \ visual 스튜디오 2010 \ projects \ Calc \ mfc_app_calculation \ mfc_app_calculationdlg.cpp (191) : 오류 C2228 : .m_Amount_of_Numbers '에는/struct/union 클래스가 있어야합니다.
    • 유형은





그것을 가져 오기 '알 수없는 형' '내가 여기 새로 왔어'입니다. @ Joachim Pileborg. 감사.

먼저 헤더 :

// MFC_App_Calculation.h : main header file for the PROJECT_NAME application 
// 

#pragma once 

#ifndef __AFXWIN_H__ 
    #error "include 'stdafx.h' before including this file for PCH" 
#endif 

#include "resource.h"  // main symbols 


// CMFC_App_CalculationApp: 
// See MFC_App_Calculation.cpp for the implementation of this class 
// 

class CMFC_App_CalculationApp : public CWinApp 
{ 
public: 
    CMFC_App_CalculationApp(); 

// Overrides 
public: 
    virtual BOOL InitInstance(); 

// Implementation 

    DECLARE_MESSAGE_MAP() 
}; 

extern CMFC_App_CalculationApp theApp; 

두 번째 헤더 :

// MFC_App_CalculationDlg.h : header file 
// 

#pragma once 


// CMFC_App_CalculationDlg dialog 
class CMFC_App_CalculationDlg : public CDialogEx 
{ 
// Construction 
public: 
    CMFC_App_CalculationDlg(CWnd* pParent = NULL); // standard constructor 

// Dialog Data 
    enum { IDD = IDD_MFC_APP_CALCULATION_DIALOG }; 

    protected: 
    virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 


// Implementation 
protected: 
    HICON m_hIcon; 

    // Generated message map functions 
    virtual BOOL OnInitDialog(); 
    afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 
    afx_msg void OnPaint(); 
    afx_msg HCURSOR OnQueryDragIcon(); 
    DECLARE_MESSAGE_MAP() 
public: 
    afx_msg void OnBnClickedRadio1(); 
    afx_msg void OnBnClickedRadio2(); 
private: 
    LCalculation m_LCalc; 
public: 
    afx_msg void OnEnChangeEdit2(); 
}; 

세 번째 헤더 :

#pragma once 
/*Comments*/ 
class LCalculation 
{ 
    public: 
     unsigned __int64 m_Amount_of_Numbers; 
     unsigned __int64 m_Amount_of_Guesses; 
     unsigned __int64 m_Probability; 
     LCalculation(); 
     bool m_bEqual; 
     void CalculateThis(); 
     void SZ_true(); 
     void SZ_false(); 
     void NUMBERequals (unsigned __int64 NUMBERS, unsigned __int64 GUESSES, unsigned __int16 IDENTIFIER); 
}; 
+0

'CMFC_App_CalculationDlg'를 정의하는 헤더 파일에'LCalcultation'을 정의하는 헤더 파일을 포함합니까? –

+1

* complete * 및 * unedited * 오류 메시지를 게시 할 수 있습니까? 그리고 소스에서 당신은 그 오류를 지적합니다. 또한'm_LottoBerechnung'은 무엇입니까? –

+0

또한 m_LottoBerechnung 선언 전에 세미콜론을 확인하십시오. 당신이 단순히 한 쌍을 놓치고있는 것 같습니다. –

답변

2

에서 당신의 두 번째 헤더 (MFC_App_CalculationDlg.h)는 #include "LCalculation.h"을 잊었거나 세 번째 헤더의 이름을 지정했습니다.

그리고 BTW, UpdateData는 BOOL을 반환하지만 amount_of_numbers는 반환하지 않습니다. MFC가 대화 상자 컨트롤과 데이터 교환을 수행하는 방법을 더 잘 이해하려면 UpdateData 및 DoDataExchange에 대한 설명서를 읽어야합니다.

+1

실제로 두 번째 헤더 였지만 감사합니다. 나는 그것을 전에 얻었다. – Blacktempel

+1

네, 방금 보았고 수정했습니다 (현재 h 파일의 이름도 제공함). –

관련 문제