예제 #1
0
파일: Addin.cs 프로젝트: toroerp/NetOffice
 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());
     }
 }
예제 #2
0
파일: Addin.cs 프로젝트: zyfzgt/Samples
 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());
     }
 }