Базовый класс c ++ Undefined C2504 - PullRequest
0 голосов
/ 10 июля 2019

У меня есть класс CConfigButton, который наследуется от CCommandButton.Я получаю неопределенную ошибку базового класса в строке 12 (наследуя CCommandButton).

Код ошибки:

Error   C2504   'CCommandButton': base class undefined  14  

ConfigButton.h

#pragma once

#ifndef CONFIG_BUTTON_H
#define CONFIG_BUTTON_H

class CConfigButton;

#include "Resource.h"
#include "CommandButton.h"



class CConfigButton :
   public CCommandButton {
public:
   //----- ButtonDefinitionSink
   STDMETHOD(ButtonDefinitionEvents_OnExecute) (NameValueMap *pContext);

};

#endif // !CONFIG_BUTTON_H

CommandButton.h

#pragma once

#ifndef COMMAND_BUTTON_H
#define COMMAND_BUTTON_H



#include "Resource.h"
#include "swentylFRCAddinAddInServer.h"

class ATL_NO_VTABLE CCommandButton;

//class CCommandButton;
// CCommandButton

class ATL_NO_VTABLE CCommandButton :
   public CComObjectRootEx<CComSingleThreadModel>,
   public IDispEventImpl<0, CCommandButton, &DIID_ButtonDefinitionSink, &LIBID_Inventor, 1, 0>
{

protected:
   //Inventor application object
   CComPtr<Application> m_pApplication;

   //Command button definition
   CComPtr<ButtonDefinitionObject> m_pCommandButtonDef;

public:
   CCommandButton()
   {
      m_pApplication = NULL;
      m_pCommandButtonDef = NULL;
   }

   DECLARE_NO_REGISTRY()

   BEGIN_COM_MAP(CCommandButton)
   END_COM_MAP()

   BEGIN_SINK_MAP(CCommandButton)
      SINK_ENTRY_EX(0, DIID_ButtonDefinitionSink, ButtonDefinitionSink_OnExecuteMeth, ButtonDefinitionEvents_OnExecute)
   END_SINK_MAP()

public:
   //----- ButtonDefinitionSink
   STDMETHOD(ButtonDefinitionEvents_OnExecute) (NameValueMap *pContext) = 0;

   HRESULT CreateButtonDefinition(Application* pApplication,
      BSTR bstrDisplayName,
      BSTR bstrInternalName,
      CommandTypesEnum eCommandType,
      VARIANT varClientId,
      BSTR bstrDescription,
      BSTR bstrToolTip,
      int StandardIconResId,
      int LargeIconResId,
      ButtonDisplayEnum eButtonDisplayType,
      ButtonDefinitionObject** pCommandButtonDefinition);

   HRESULT GetButtonDefinition(ButtonDefinitionObject** pCommandButtonDef);

   HRESULT Disconnect();
};

#endif // !COMMAND_BUTTON_H

Я искал другие похожие проблемы, но не смогли найти решение.Другие предполагают, что круговая зависимость является одним из возможных источников проблемы, но я не верю, что сделал это.Как мне это исправить?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...