@rustam6548

Почему при подключении dll, в котором содержится класс, переносится не весь функционал класса?

Я пытаюсь добавить обычной Button несколько свойств - название и цену товара.
Вот так выглядит реализация:
namespace CustomLibrary {

	public ref class CustomButton : System::Windows::Forms::Button
	{
	private:
		String^ GoodName;
		int GoodPrice;

	public:
		String^ GetGoodName() {
			return GoodName;
		}

		int GetGoodPrice() {
			return GoodPrice;
		}

		void SetGoodName(String^ GoodName) {
			this->GoodName = GoodName;
		}

		void SetGoodPrice(int GoodPrice) {
			this->GoodPrice = GoodPrice;
		}

		CustomButton(void)
		{
			InitializeComponent();
			this->UseVisualStyleBackColor = true;
			this->Font = gcnew System::Drawing::Font(L"Arial", 18);
		}

	protected:
		~CustomButton()
		{
			if (components)
			{
				delete components;
			}
		}

	private:
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		void InitializeComponent(void)
		{
			this->SuspendLayout();
			this->ResumeLayout(false);
		}
#pragma endregion
	};
}

Собираю проект, создаётся dll, переношу его в другой проект, добавляю его на панель элементов для размещения в форме модифицированной кнопки. Всё работает, но при обращении к геттерам и сеттерам пишет, что они не являются членами класса CustomButton.
  • Вопрос задан
  • 58 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы