Wiki der Access Code Library

Gemeinsam zu mehr Effizienz in der Anwendungserstellung

AccUnit:Hinweise und Notizen zum Quellcode

Aus Access Code Library
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
K
K
Zeile 13: Zeile 13:
OfficeApplication.GetType().InvokeMember("Run", BindingFlags.InvokeMethod, null, OfficeApplication,  
OfficeApplication.GetType().InvokeMember("Run", BindingFlags.InvokeMethod, null, OfficeApplication,  
                                         parameters, modifiers, null, null);</source>
                                         parameters, modifiers, null, null);</source>
 +
 +
* VBEIDE-Fenster mit ms.net erzeugen
 +
[http://www.mztools.com/articles/2006/MZ2006007.aspx HOWTO: Create a dockable toolwindow from a Visual Studio .NET add-in]

Version vom 17:28, 23. Aug. 2010

  • Object statt Variant in COM Interface: [MarshalAs(UnmanagedType.IDispatch)]
void CallTestByName(string procName, [MarshalAs(UnmanagedType.IDispatch)] out object test2Add);
 
object Fixture { [return: MarshalAs(UnmanagedType.IDispatch)]  get; }
 
object Parent { [param: MarshalAs(UnmanagedType.IDispatch)] set; [return: MarshalAs(UnmanagedType.IDispatch)] get; }
  • ByRef-Übergabe mit InvokeMember und Application.Run: ParameterModifier verwenden - damit kann ByRef markiert werden
object[] parameters = { getTestClassFactoryProcedureName(className), new Object() };
ParameterModifier p = new ParameterModifier(2);
p[1] = true;
ParameterModifier[] modifiers = { p };
 
OfficeApplication.GetType().InvokeMember("Run", BindingFlags.InvokeMethod, null, OfficeApplication, 
                                         parameters, modifiers, null, null);
  • VBEIDE-Fenster mit ms.net erzeugen

HOWTO: Create a dockable toolwindow from a Visual Studio .NET add-in