diff --git a/include/wx/msw/checkbox.h b/include/wx/msw/checkbox.h index 579e197f9d..bc2eaf460b 100644 --- a/include/wx/msw/checkbox.h +++ b/include/wx/msw/checkbox.h @@ -13,6 +13,13 @@ #include "wx/msw/ownerdrawnbutton.h" +#ifdef __VISUALC__ + // Disable the warning about non DLL-exported wxMSWOwnerDrawnButton class + // used as base for DLL-exported class: it's harmless in this case. + #pragma warning(push) + #pragma warning(disable:4275) +#endif + // Checkbox item (single checkbox) class WXDLLIMPEXP_CORE wxCheckBox : public wxMSWOwnerDrawnButton { @@ -77,5 +84,8 @@ private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckBox) }; +#ifdef __VISUALC__ + #pragma warning(pop) #endif - // _WX_CHECKBOX_H_ + +#endif // _WX_CHECKBOX_H_ diff --git a/include/wx/msw/ownerdrawnbutton.h b/include/wx/msw/ownerdrawnbutton.h index 19a35031d6..527a9c2529 100644 --- a/include/wx/msw/ownerdrawnbutton.h +++ b/include/wx/msw/ownerdrawnbutton.h @@ -17,8 +17,10 @@ // This class contains the type-independent part of wxMSWOwnerDrawnButton and // is implemented in src/msw/control.cpp. // -// Notice that it is intentionally not exported, it is internal implementation -// detail only. +// Notice that it is intentionally not DLL-exported, it is internal +// implementation detail only. However MSVS generates a warning C4275 when +// deriving from the non-exported classes, so it needs to be explicitly +// disabled when deriving from this one. class wxMSWOwnerDrawnButtonBase { protected: diff --git a/include/wx/msw/radiobut.h b/include/wx/msw/radiobut.h index 4f86e1eeef..a7da5f3f7d 100644 --- a/include/wx/msw/radiobut.h +++ b/include/wx/msw/radiobut.h @@ -13,6 +13,13 @@ #include "wx/msw/ownerdrawnbutton.h" +#ifdef __VISUALC__ + // Disable the warning about non DLL-exported wxMSWOwnerDrawnButton class + // used as base for DLL-exported class: it's harmless in this case. + #pragma warning(push) + #pragma warning(disable:4275) +#endif + class WXDLLIMPEXP_CORE wxRadioButton : public wxMSWOwnerDrawnButton { public: @@ -78,5 +85,8 @@ private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton) }; +#ifdef __VISUALC__ + #pragma warning(pop) #endif - // _WX_RADIOBUT_H_ + +#endif // _WX_RADIOBUT_H_