com

How to pass a variant object type 16396 in a COM method that requires an input value of a VT_VARIANT [12]

房东的猫 提交于 2019-12-04 21:48:45
I have in my PHP code, a COM object '$com_myObject' with a method 'myObjectMethod' which after I run com_print_type info($com_myObject); on it, it shows that it has the method 'myObjectMethod' declared as shown below myObjectMethod(/* VT_VARIANT [12] [in] */ $RawData) { /* Processes entered object data */ } In my code I am having another function return a variant object '$myInputObject' of type value 16396. I plan to use '$myInputObject' as the input value for 'myObjectMethod' method. print variant_get_type($myInputObject); //returns 16396 I am retrieving the value for '$myInputObject' as

Building .NET COMInterop project without first registering the COM service

南笙酒味 提交于 2019-12-04 21:43:18
I am building a C# UI to interact with a COM Service (.exe). The VS2005 COM project outputs a valid typelib (TLB), which is referenced by the C# project. However, the VS2005 C# project insists that the service be registered in order to build the C# project, even though the typelib appears perfectly valid when examined with the OLE Object Viewer. We would rather not register the service on the build server, if possible. Further, debug builds cannot register the COM object as a service, since this makes debugging in general, and startup code in particular, more difficult (can't use F5 - Start

Cannot call COM object created from STAThread from oher STA threads

倾然丶 夕夏残阳落幕 提交于 2019-12-04 21:26:07
问题 I am new to COM and trying to understand the difference between STA and MTA. I tried to create an example that would show that COM can manage calls to object created in STA that is not thread-safe. MyCalcServer class here is created using ATL Simple Object. The settings used are the same as in this article: Threading Model: Apartment Aggregation: No Interface: Custom MyCalcServer COM object is used in another C# project which is: class Program { [STAThread] static void Main(string[] args) {

AutoHotkey's ComObjActive handle to specific Worksheet

你。 提交于 2019-12-04 21:13:36
The simplest way to create a handle to your currently active Excel sheets in your .ahk script is: Xl := ComObjActive("Excel.Application") Nonetheless, if one switches to another workbook, this becomes the new " currently active sheet " and AutoHotkey tries to use methods for sheets and cells on the new workbook through COM: of course scripts designed to work with specific sheets and cells don't work anymore on a different workbook. Do you know how to create COM handles to specific workbooks instead of currently active sheet? The goal should be to allow the user to loop between workbooks

C++ COM Object Hotpatching?

房东的猫 提交于 2019-12-04 20:41:32
Background: I'm hooking on windows COM object. The method used is vtable modification. say we have an instance of interface A named instance , it contains oldmethod in the interface, I replaced with newmethod . However, in my newmethod I need to know the address of oldmethod so that I can call oldmethod after doing my own thing. It is not safe to store the address of oldmethod in a global variable, since there might be more than one implementation behind interface A , let's say there are two implementations, class A1 and class A2 . Thus my newmethod needs to store both A1->oldmethod and A2-

What does MethodImplAttribute(InternalCall, Runtime) do for methods of COM Interop interfaces?

两盒软妹~` 提交于 2019-12-04 20:23:01
问题 In Windows API Code Pack for .NET Framework, many methods of COM Interop interfaces are decorated with MethodImplAttribute , for example: internal interface IShellItem { [PreserveSig] [MethodImpl( MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] HResult BindToHandler( [In] IntPtr pbc, [In] ref Guid bhid, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IShellFolder ppv); Documentation for MethodImplOptions.InternalCall value says: The call is internal

How to communicate between two COM objects using Running Object Table (ROT)?

我的未来我决定 提交于 2019-12-04 20:06:27
问题 I have two COM objects written in C++ and ATL. There are in one library and I know their IIDs and CLIDs. I can't find an example of doing this simple communication between two simple COM objects. How to create IMoniker and how to add it to ROT? And then, how to retrieve pointer of this object,in other COM in different process/thread? Does anyone can provide a small example? EDIT : More info: I'm writing an add-on for IE. There are two COM object completely unrelated that IE load for different

Exposing events from .NET to COM

霸气de小男生 提交于 2019-12-04 19:47:07
recently I have been encountering problems with exposing events from .NET to COM. I have been successful with this example (conceptually taken from http://blogs.msdn.com/andreww/archive/2008/10/13/exposing-events-from-managed-add-in-objects.aspx ): // The delegate type for our custom event. [ComVisible(false)] public delegate void SomeEventHandler(object sender, EventArgs e); // Outgoing (source/event) interface. [ComVisible(true)] [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface IAddInEvents { [DispId(1)] void SomeEvent(object sender, EventArgs e); } [ComVisible(true)]

Is there a better way (besides COM) to remote-control Excel?

我怕爱的太早我们不能终老 提交于 2019-12-04 19:43:24
I'm working on a regression-testing tool that will validate a very large number of Excel spreadsheets. At the moment I control them via COM from a Python script using the latest version of the pywin32 product. Unfortunately COM seems to have a number of annoying drawbacks: For example, the slightest upset seems to be able to break the connection to the COM-Server, once severed there seems to be no safe way to re-connect to the Excel application. There's absolutely no safety built into the COM Application object. The Excel COM interface will not allow me to safely remote-control two seperate

Can't get package references registered to an instance of Visual Studio 17 and above from Pascal Script

馋奶兔 提交于 2019-12-04 19:09:50
I need to define whether a specific extension is installed in Visual Studio 2017. I can get package references registered to the instance of VS using Microsoft.VisualStudio.Setup.Configuration.Interop with C#. Here is example of the working code: var query = (ISetupConfiguration2) new SetupConfiguration(); var e = query.EnumInstances(); int fetched; var instances = new ISetupInstance[1]; do { e.Next(1, instances, out fetched); if (fetched <= 0) continue; ISetupInstance2 instance = instances[0] as ISetupInstance2; if (instance == null) continue; var temp = instance.GetPackages(); var temp2 =