VS2010 Compiler Problem "CUserTool"



  • Hallo Leute,
    ich hab da glaub ich ein großes Problem beim Compilieren meiner Programme.
    Wenn ich den Quellcode eines Programms ändere u. sei es nur eine "MessageBox" Anweisung einfüge u. neu Compiliere, bekomme ich etliche Fehlermeldungen:

    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(31): error C2653: 'CUserTool': Keine Klasse oder Namespace
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(31): error C2653: 'CUserTool': Keine Klasse oder Namespace
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(41): error C2143: Syntaxfehler: Es fehlt ';' vor ''
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(41): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(41): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(41): warning C4183: 'CreateNewTool': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(42): error C2061: Syntaxfehler: Bezeichner 'CUserTool'
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(44): error C2061: Syntaxfehler: Bezeichner 'CUserTool'
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(45): error C2061: Syntaxfehler: Bezeichner 'CUserTool'
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(51): error C2143: Syntaxfehler: Es fehlt ';' vor '
    '
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(51): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(51): error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.
    c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxusertoolsmanager.h(51): warning C4183: 'FindTool': Rückgabetyp fehlt; Memberfunktion, die 'int' zurückgibt wird angenommen
    ========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========

    Das passiert bei allen meinen Projektmappen. Wenn ich ein Projekt öffne u. ohne eine Codeänderung Compiliere geht alles glatt. Habe VS2010 auch schon "Gewartet"

    Hier noch der Quellcode mit einigen Fehlern:

    // This is a part of the Microsoft Foundation Classes C++ library.
    // Copyright (C) Microsoft Corporation
    // All rights reserved.
    //
    // This source code is only intended as a supplement to the
    // Microsoft Foundation Classes Reference and related
    // electronic documentation provided with the library.
    // See these sources for detailed information regarding the
    // Microsoft Foundation Classes product.
    
    #pragma once
    
    #include "afxcontrolbarutil.h"
    
    #ifdef _AFX_PACKING
    #pragma pack(push, _AFX_PACKING)
    #endif
    
    #ifdef _AFX_MINREBUILD
    #pragma component(minrebuild, off)
    #endif
    
    class CUserToolsManager : public CObject
    {
    public:
    	//--------------
    	// Construction:
    	//--------------
    	CUserToolsManager();
    	CUserToolsManager(	const UINT uiCmdToolsDummy, const UINT uiCmdFirst, const UINT uiCmdLast,
    		CRuntimeClass* pToolRTC = RUNTIME_CLASS(CUserTool), UINT uArgMenuID = 0, UINT uInitDirMenuID = 0);
    	virtual ~CUserToolsManager();
    
    	//------------
    	// Operations:
    	//------------
    	BOOL LoadState(LPCTSTR lpszProfileName = NULL);
    	BOOL SaveState(LPCTSTR lpszProfileName = NULL);
    
    	  :warning: CUserTool* CreateNewTool();
    	BOOL RemoveTool( :warning: CUserTool* pTool);
    
    	BOOL MoveToolUp( :warning: CUserTool* pTool);
    	BOOL MoveToolDown( :warning: CUserTool* pTool);
    
    	BOOL IsUserToolCmd(UINT uiCmdId) const { return uiCmdId >= m_uiCmdFirst && uiCmdId <= m_uiCmdLast; }
    	UINT GetToolsEntryCmd() const { return m_uiCmdToolsDummy; }
    
    	BOOL InvokeTool(UINT uiCmdId);
    	CUserTool* FindTool(UINT uiCmdId) const;
    
    	//------------
    	// Attributes:
    	//------------
    public:
    	const CObList& GetUserTools() const { return m_lstUserTools; }
    	int GetMaxTools() const { return m_uiCmdLast - m_uiCmdFirst + 1; }
    
    	void SetFilter(const CString& strFilter) { m_strFilter = strFilter; }
    	const CString& GetFilter() const { return m_strFilter; }
    
    	void SetDefExt(const CString& strDefExt) { m_strDefExt = strDefExt; }
    	const CString& GetDefExt() const { return m_strDefExt; }
    
    	UINT GetArgumentsMenuID() const { return m_uiArgumentsMenuID; }
    	UINT GetInitialDirMenuID() const { return m_uiInitialDirMenuID; }
    
    protected:
    	CObList             m_lstUserTools;       // List of CUserTool-derived objects
    	const UINT          m_uiCmdToolsDummy;    // Will be replaced by the tools list
    	const UINT          m_uiCmdFirst;         // First user tool command
    	const UINT          m_uiCmdLast;          // Last user tool command
    	CRuntimeClass*      m_pToolRTC;           // User tool run-time class
    	CString             m_strFilter;          // "Add tool" file dilaog filter
    	CString             m_strDefExt;          // Default tool file extension
    	const UINT          m_uiArgumentsMenuID;  // ID for arguments popup option menu
    	const UINT          m_uiInitialDirMenuID; // ID for initial dir popup option menu
    };
    
    extern AFX_IMPORT_DATA CUserToolsManager* afxUserToolsManager;
    
    #ifdef _AFX_MINREBUILD
    #pragma component(minrebuild, on)
    #endif
    
    #ifdef _AFX_PACKING
    #pragma pack(pop)
    #endif
    

  • Mod

    Das ist kein Fehler. Du hast nicht die richtigen includes in Deinem Projekt.
    Hast Du wirklich einen

    #include "afxwinappex.h"
    

    gemacht?



  • Hey Martin,
    ich habe an diesen include - Dateien noch nie was geändert.

    Hab jetzt #include "afxwinappex.h" mit eingefügt u. es funktioniert wieder.
    Aber wie kann das sein?


  • Mod

    Du hast was verändert... 🕶 ... jede Wette!



  • Nee, hab ich nicht. Das gleiche passierte mir ja bei drei verschiedenen Projekten.
    Zwei von VS2005 konvertierte u. ein Original VS2010 Projekt.Hab nur Änderungen im View oder Dialogen gemacht. Da hätte ich mich jetzt blöde gesucht mit dem include. Und wahrscheinlich nie gefunden!

    Dank Dir Martin. 🙂


Anmelden zum Antworten