Hi Doug: Nope... I put the requsit globals in the root module and all the
subroutines executed related to them in the root module as well. That is one
of the final things I tried because, as you noted, each sub must relate to a
process and to a global within the current container when it comes to com
stuff and callbacks.
So, your concept seems to match what I have found as well when it comes to
that.
I am wondering if anyone, anyplace in this wide world has gotten an external
script to work which uses MSAA event processing. I haven't seen one yet but
am listening for something, anything, that might indicate that this can
actually be done in a real-world example of an associated external script.
The GW sample avoids any complications like using MSAA Event processing and
even the most fundemental process of using an associated application. But, I
digress and that is off point.
Later.Rick USA
----- Original Message -----
From: "Doug Lee" <doug....@ssbbartgroup.com>
To: <gw-scripting@gwmicro.com>
Sent: Saturday, April 02, 2011 2:51 PM
Subject: Re: External Script, ProcessID and Third Test Output Results
I haven't followed this thread carefully, but are you trying to use a
class method for an event function? As far as I know, you can't do
that in VBScript or Javascript because you can't make anything but a
top-level function into an event watcher. I assume this problem also
manifests in other languages as a requirement that any event appear in
the top-level namespace, but I haven't proven this.
On Sat, Apr 02, 2011 at 02:01:03PM -0400, RicksPlace wrote:
Hi Again from the External Front:
To better match the GW sample I moved all logic into the Root Module to
avoid any possible conflict of process implementation due to putting
the logic into the Class that defines the Message Pump context.
Now the Run command executes an empty class with only a New Constructor
sub that does nothing but create a dummy message pump.
All logic and variables are defined in the Root Module and globals are
defined at the Module level as they were in the GW Example of a VB.net
script.
Again, the BlockEvent and the OnShutdown events work perfectly but the
WatchEvent is still not working even though it seems to be using the
correct process as described below.
This is leading me to think that there might be a problem with the
Windoweyes implementation of the WatchEvent itself but I'm not a COM
Guru so am not 100 percent sure.
The Process held in the ClientInformation object appears to be correct
which is the process of the Overlap Window which should, and is, the
CSharp Application Window.
Therefore, when I filter the MSAAEventSource used with the WatchEvent
the process should be correct and thus the WatchEvent should be firing
unless I am missing something.
Again, it works as expected with the BlockEvent indicating something
might be wrong with the WatchEvent itself or my implementation of it.
At this point I think I need Aaron or someone from GW, or an
experienced Windoweyes External scriptor, to take a look at things to
determine if there is a problem with the Windoweyes implementation of
this feature or if I am still doing something wrong.
Below are some lists of objects and properties indicating that the
process I use is correct which means that everything should be working
if I have not made some subtle, or stupid, mistake I can't find.
BeginCopiedOutput:
Enter Main Sub
ClientInformation Initialized OK
MyMSAAEventSource Initialized and Filtered OK
BlockFocusEvent Initialized OK.
MyMSAAEventSource.WatchEvent sub executed with no errors.
BeginList: Overlap Object to Main Module
ClassName: wndclass_desked_gsk
Handle: 853216
ModuleName: MSENV
Name: Microsoft Visual C# 2008 Expres
OriginalClassName: wndclass_desked_gsk
OriginalType: 7
Process.ProcessID: 680
Style: System.__ComObject
Title: Start Page - Microsoft Visual C# 2008 Express Edition
Type: 7
EndList: Overlap Object to Main Module
Note: The above is the CSharp overlap information.
Notice that the process id is 680.
BeginList: ClientInformation.ApplicationProcess
ProcessID: 680
ModuleName: vcsexpress
ExecutablePath: C:\Program Files\Microsoft Visual Studio
9.0\Common7\IDE\vcsexpress.exe
InternalName: VCSExpress.exe
OriginalFilename: VCSExpress.exe
ProductName: Microsoft® Visual Studio® 2008
ProductVersion: 9.0.30729.1
EndList: ClientInformation.ApplicationProcess
Notice that the process id matches the overlap process id of 680.
That means that when I assign the Process id of 680 to the BlockEvent
via the MyClientInformation Process and,
the WatchEvent via the MyMSAAEventSource using the MyClientInformation
process,
that they both should be applied to watch the same process ie... the
CSharp Application process.
The BlockEvent works as expected but the WatchEvent is not working.
RunPump Statement is next
The New Context Pump is initialized.
Shutting Down Now
Notice that the words "Shutting Down Now" are in the OnShutdown sub
fired when that event occurs as triggered in the MyClientInformation
process further indicating something is diferent with the WatchEvent
method.
EndCopiedOutput:
Thanks for all your help.
This puppy just doesn't seem to hunt and I can't figure out why.
Rick USA
--
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:doug....@ssbbartgroup.com http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller