Search found 10 matches
- 23 Oct 2014, 14:58
- Forum: Ask for Help (v1)
- Topic: Accessing COM applications from the Running Object Table
- Replies: 2
- Views: 2722
Re: Accessing COM applications from the Running Object Table
Or, instead of translating C#, how about translating MSDN ? pprot [out] The address of an IRunningObjectTable* pointer variable that receives the interface pointer to the local ROT. When the function is successful, the caller is responsible for calling Release on the interface pointer. If an error o...
- 22 Oct 2014, 12:41
- Forum: Ask for Help (v1)
- Topic: Accessing COM applications from the Running Object Table
- Replies: 2
- Views: 2722
Accessing COM applications from the Running Object Table
Having gotten AHK working with my COM API, I now find that I need to distinguish between multiple instances running simultaneously. ComObjActive can only get the first instance per Prog ID because of limitations of the MS API. I think the work-around is to access the Running Object Table (ROT). Belo...
- 16 Oct 2014, 08:27
- Forum: Ask for Help (v1)
- Topic: Passing Arrays ByRef to COM API
- Replies: 14
- Views: 6173
Re: Passing Arrays ByRef to COM API
Great! Thanks for all your explanations.
- 15 Oct 2014, 09:29
- Forum: Ask for Help (v1)
- Topic: Passing Arrays ByRef to COM API
- Replies: 14
- Views: 6173
Re: Passing Arrays ByRef to COM API
I just meant, why doesn't ComObject() require an & in ComVar(), when it does require one in your working solution. Still trying to replace ComVar: ComVar(Type=0xC) { static base := { __Get: "ComVarGet", __Set: "ComVarSet", __Delete: "ComVarDel" } ; Create an array of type Type. arr := ComObjArray(Ty...
- 14 Oct 2014, 15:53
- Forum: Ask for Help (v1)
- Topic: Passing Arrays ByRef to COM API
- Replies: 14
- Views: 6173
Re: Passing Arrays ByRef to COM API
Thank you, that worked! I used 1 for all lengths, and the API expanded the array as required. And by changing 0x6000 to 0x4000, it worked for non-arrays as well. For my understanding, why did the ComVar function not require the address of the array? arr := ComObjArray(element_type, length) DllCall("...
- 10 Oct 2014, 09:58
- Forum: Ask for Help (v1)
- Topic: Passing Arrays ByRef to COM API
- Replies: 14
- Views: 6173
Re: Passing Arrays ByRef to COM API
Thanks for your time, and your clarifications. Back to my original question, I think know what the API wants (because it's stated in the documentation and because it works in VBA): an array of long (or string, boolean, whatever) passed by reference. I did see your test build, which is why I finally ...
- 09 Oct 2014, 11:05
- Forum: Ask for Help (v1)
- Topic: Passing Arrays ByRef to COM API
- Replies: 14
- Views: 6173
Re: Passing Arrays ByRef to COM API
Yes. I just tried again, and got the Type Mismatch error again. I need at least ComObjParameter to pass the correct type. Maybe the problem is that ComObjArray (used in ComVar) ignores VT_ARRAY? I just tried this, which gets past the error point above, but then crashes AHK: SapObject := ComObjActive...
- 09 Oct 2014, 09:55
- Forum: Ask for Help (v1)
- Topic: Passing Arrays ByRef to COM API
- Replies: 14
- Views: 6173
Re: Passing Arrays ByRef to COM API
ComVar() is equivalent to ComVar(0xC), which returns a Type Mismatch error. I have successfully used ComVar(4), ComVar(0xB), etc when passing non-arrays ByRef to the API. These functions also return Type Mismatch errors if I use just ComVar(). That is why I think it is a problem with object handling...
- 09 Oct 2014, 09:20
- Forum: Ask for Help (v1)
- Topic: Passing Arrays ByRef to COM API
- Replies: 14
- Views: 6173
Re: Passing Arrays ByRef to COM API
Sorry, I forgot I was using the modified version of ComVar that lets me pass the Type as an argument (otherwise the API returns an Type Mismatch error). The API expects a empty array, fills it, and returns it ByRef. The original ComVar is here: https://github.com/cocobelgica/AutoHotkey-ComDispatch/b...
- 09 Oct 2014, 08:36
- Forum: Ask for Help (v1)
- Topic: Passing Arrays ByRef to COM API
- Replies: 14
- Views: 6173
Passing Arrays ByRef to COM API
I am writing a script to automate a third-party application using its COM API. I have fully working VBA code, and partially working AHK code. But I am stuck at the point when the API wants to return an array ByRef - I get "Error: 0x800706F4 - A null reference pointer was passed to the stub.". I have...