C++使用C#的控件

C++写上位机调用AxInterop.ActUtlTypeLib.dll.

初始化

namespace plc
{
    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
        AxActUtlTypeLib::AxActUtlType ^axActUtlType = gcnew AxActUtlTypeLib::AxActUtlType();
        Form1()

        {
              (cli::safe_cast(this->axActUtlType))->BeginInit();
               this->Controls->Add(this->axActUtlType);
              (cli::safe_cast(this->axActUtlType))->EndInit();
        }
    };
}

调用

gcroot*_plc = new gcroot;

你可能感兴趣的:(C++)