Code:
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;using AlibreX;
namespace AlibreDesign {
public static class AddOn {
public static void AddOnLoad(uint windowHandle, IntPtr pAutomationHook, IntPtr reserved) {}
public static void AddOnInvoke(uint windowHandle, IntPtr pAutomationHook, string sessionName, bool isLicensed, IntPtr reserved1, IntPtr reserved2) {
IAutomationHook hook = (IAutomationHook)Marshal.GetUniqueObjectForIUnknown(pAutomationHook);
if (hook != null) {
IADRoot root = (IADRoot)hook.Root;
MessageBox.Show(root.Version);
} // if
}
public static void AddOnUnload(uint windowHandle, bool forceUnload, bool cancel, IntPtr reserved1, IntPtr reserved2) {}
}
}