private static void UnRegister(Type type, RegisterCall registerCall, InstallScope scope, OfficeRegisterKeyState keyState) { try { using (CdeclHandle libray = CdeclHandle.LoadLibrary <Addin>("Excel06AddinCS4.Shim.dll")) { SayHello hello = libray.GetDelegateForFunctionPointer <SayHello>("SayHelloToTheWorld"); hello("Unregister Excel06AddinCS4"); } } catch (Exception ex) { Office.Tools.Contribution.DialogUtils.ShowMessageBox(ex.ToString()); } }
private static void Register(Type type, RegisterCall registerCall, InstallScope scope, OfficeRegisterKeyState keyState) { try { // requires NetOffice 1.7.4.2+ using (CdeclHandle libray = CdeclHandle.LoadLibrary(typeof(Addin), "Excel06AddinCS4.Shim.dll")) { SayHello hello = libray.GetDelegateForFunctionPointer("SayHelloToTheWorld", typeof(SayHello)) as SayHello; hello("Excel06AddinCS4"); } } catch (Exception ex) { Office.Tools.Contribution.DialogUtils.ShowMessageBox(ex.ToString()); } }