Hi Rick,
This is one link to get started on. You can also use or setup shared
objects to go with what this page states and the other links associated with it.
http://msdn.microsoft.com/en-us/library/ee671194(v=vs.85).aspx
Bruce
Sent: Friday, June 08, 2012 6:26 AM
Subject: A VBS and Wrappers Question
Hi Guys:
After struggling with UIA in my External script I am wondering if there are
unique advantages to creating a UIA script in VBS - that is one that works with
both the WE Object Model and UIA where each is most appropriate.
I wrote to the UIA Forum hosted by a developer of the UIA Native DLL to ask
about a few things including using VBS as a scripting language.
He said that VBS could not access some things without using "Wrappers" which
I dont really understand yet.
It sounds like creating a COM DLL or something but I've not looked into it
since I am working with the Managed Code Framework for UIA in my current
External Script.
That said, if there are major advantages to using VBS I might go that route
downline as I learn more about UIA.
Do any of you have solid experience creating "Wrappers" and especially
related to accessing UIA or Managed Modules?
The Microsoft Programmer's name is "Guy" and here is what he wrote back:
... prior stuff unrelated to vbs ...
Regarding VBScript, I don't believe the native-code UIA API can be called
from VBScript.
VBScript requires the COM objects to support the IDispatch interface, and the
native-code
UIA API doesn't support that. But while I've not does this myself, you should
be
able to call a COM wrapper from VB.Net which calls into the native-code UIA
API.
I have some C# samples which call into a COM wrapper like this. For example,
http://code.msdn.microsoft.com/Windows-7-UI-Automation-9ce18fd5
and
http://code.msdn.microsoft.com/Windows-7-UI-Automation-9ce18fd5
. There a couple of different approaches for generating a wrapper for the
native-code
UIA API, and I've described these up at
http://social.msdn.microsoft.com/Forums/en-US/windowsaccessibilityandautomation/thread/c3f142e1-0624-4ec5-a313-482e72d5454d
and
http://social.msdn.microsoft.com/Forums/en-TT/windowsaccessibilityandautomation/thread/5b043035-b1eb-4c6c-944c-5ce8df28b1ee
.
If you do generate a COM wrapper and reference it in a C# (or I assume a
VB.Net)
project, Visual Studio's Object Browser will show the contents of the
wrapper, and
Intellisense works in VS to help write the code which references the
wrapper's data
types.
... rest gets into the VS Forms Designer...
First, it sounds like the "Wrappers" are COM objects like what WindowEyes
should be implementing rather than a script but I am not sure.
Second, as VBS Programmers have you developed Wrappers in VBS to get at
functions inside other COM Objects like Guy mentions?
I have not done this since my script is already in Managed Code but would
have to do it if I switched to VBS unless GW has already done it within their
Object Model somehow.
So that is my question, has anyone created COM Wrappers over DLLs using VBS
and does this sound like what Guy is describing in the Forum reply.
I will go look at his examples, actually I peeked at them and that is why I
am pretty sure they are COM wrappers but would like to know it can, has, been
done in VBS before I even consider working in VBS to create a UIA / WE Object
Model script since it might add too much complexity to the project.
So, let me know what you have done with this technical set (COM Wrappers" in
VBS.
Later Guys:
Rick USA