精易论坛

标题: 不懂C,那位大佬能帮转换下成易吗 [打印本页]

作者: lhlabfaogo    时间: 2024-4-29 16:23
标题: 不懂C,那位大佬能帮转换下成易吗
using System;using System.Windows.Forms;using Radraft.Interop;namespace MyFirstPlugIn    {    // The special plug-in class    public class RadraftInteropPlugIn        {        // Private member to store a handle to the Application object        private Radraft.Interop.Application m_app = null;        // This is called once when the plug-in is loaded        public void OnConnectToApplication(Radraft.Interop.Application app)            {            // Store the handle to the Application object so we can make calls to the API            m_app = app;            }        // This is called everytime the menu bar needs updating        public void OnUpdateGUI()            {            // Add an item to the Plug-Ins menu. This will appear in every GUI state.            m_app.PluginManager.AddMenuItem("Plug-Ins", "Show Date", "OnShowDate");            // Add a new menu to the menu bar. This will only be shown when in Tooling mode in the Part Editor.            RadGUIState gs = m_app.GUIState;            RadGUISubState gss = m_app.GUISubState;            if (gs == RadGUIState.radPart && gss == RadGUISubState.radTooling)                {                m_app.PluginManager.AddMenu("", "Example");                m_app.PluginManager.AddMenu("Example", "Software");                m_app.PluginManager.AddMenuItem("Example|Software", "Show name", "OnShowName");                m_app.PluginManager.AddMenuItem("Example|Software", "Show version", "OnShowVersion");                }            }        // Menu item handler        private void OnShowDate()            {            MessageBox.Show(DateTime.Now.ToString());            }        // Menu item handler        private void OnShowName()            {            MessageBox.Show(m_app.Name);            }        // Menu item handler        private void OnShowVersion()            {            MessageBox.Show(m_app.SoftwareVersion);            }        }    }以上是C的代码 是一个动态连接库 这个代码是用来添加 一个软件的菜单 看得一脸MB 那位大佬能转下易吗 不知道怎么写 从没写过动态连接库

作者: 承易    时间: 2024-4-29 17:46
你用AI 转成DLL让易调用




欢迎光临 精易论坛 (https://125.confly.eu.org/) Powered by Discuz! X3.4