[jawsscripts] Re: Registration-free COM via CreateObject

  • From: Jamal Mazrui <empower@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Tue, 17 Jan 2012 10:08:33 -0500

I have verified that passing the argument 2 is different from the number 
1, or 3, or 4 -- so there is, apparently, an undocumented value that 
alters CreateObject behavior.

As previously mentioned, I have not gotten the GetObject technique to 
work on Win64 with a Windows Script Component file (.wsc) containing 
VBScript and JScript code.  I then tried registering the file with the 
command
RegSvr32.exe HomerJax.wsc

To my surprise, that seem to work, except that there now seems to be a 
threading problem with the operation of the COM server from a JAWS 
script.  Some methods of the COM object work fine, but in other cases, 
the JAWS script returns from the method call before it has completed.  
At first, I thought the JScript method was aborting due to an error, but 
when I use a method of the COM server to display the return value just 
before exiting the method (where control would normally return to the 
JAWS script), the return value is actually correct.  The JAWS call 
returns right away, however, with a blank value.

If anyone has additional ideas for debugging this, please let me know.

Jamal


On 1/17/2012 2:09 AM, John Martyn wrote:
> I have no idea, but 2 worked while the others didn't in windows 7. That was
> what someone in the scripting department gave me as a solution to when
> CreateObject didn't work. I didn't ask any further, but perhaps I can ask
> them a little more about this particular function.
> John
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Doug Lee
> Sent: Monday, January 16, 2012 3:47 PM
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Registration-free COM via CreateObject
>
> 2? That parameter of CreateObjectEx is usually just True (1) or False (0).
> Do you have any idea what 2 does, if anything different than True?
>
> On Mon, Jan 16, 2012 at 03:33:43PM -0800, John Martyn wrote:
> As far as I have used as an example, iTunes on windows 7 only allowed
> CreateObjectX ("iTunes.application",2) John
>
> -----Original Message-----
> From: jawsscripts-bounce@xxxxxxxxxxxxx
> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
> Sent: Monday, January 16, 2012 9:52 AM
> To: jawsscripts@xxxxxxxxxxxxx
> Subject: [jawsscripts] Re: Registration-free COM via CreateObject
>
> Here's such a DLL manifest from something I was working on.  I just hope the
> xml doesn't get screwed up by going through the email system.
>   In the project this comes from it gets embedded into the dll with resource
> ID 2.
>
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>  <assembly
> xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
> <assemblyIdentity type="win32" name="HccEditScriptingUD_x64"
> version="1.0.0.1" processorArchitecture="AMD64"  publicKeyToken="*"/>  <file
> name="HccEditScriptingUD_x64.dll">
>   <comClass clsid="{6c89905f-bf76-11e0-a394-005056c00008}"
> tlbid="{6c89905d-bf76-11e0-a394-005056c00008}"
> threadingModel="Apartment" progid="HccEditScripting.HccEdit"
> description="HccEdit main object" />
>   <comClass clsid="{6c899062-bf76-11e0-a394-005056c00008}"
> tlbid="{6c89905d-bf76-11e0-a394-005056c00008}"
> threadingModel="Apartment" progid="HccEditScripting.HccEditWindow"
> description="HccEdit window object" />
>   <comClass clsid="{6c899064-bf76-11e0-a394-005056c00008}"
> tlbid="{6c89905d-bf76-11e0-a394-005056c00008}"
> threadingModel="Apartment" progid="HccEditScripting.HccEditKeymap"
> description="HccEdit keymap object" />
>   <comClass clsid="{6c899066-bf76-11e0-a394-005056c00008}"
> tlbid="{6c89905d-bf76-11e0-a394-005056c00008}"
> threadingModel="Apartment" progid="HccEditScripting.HccEditFrame"
> description="HccEdit frame object" />
>   <comClass clsid="{6c899068-bf76-11e0-a394-005056c00008}"
> tlbid="{6c89905d-bf76-11e0-a394-005056c00008}"
> threadingModel="Apartment"
> progid="HccEditScripting.HccEditWindowsCollection"
> description="HccEdit window collection object" />   <comClass
> clsid="{6c89906a-bf76-11e0-a394-005056c00008}"
> tlbid="{6c89905d-bf76-11e0-a394-005056c00008}"
> threadingModel="Apartment"
> progid="HccEditScripting.HccEditFramesCollection" description="HccEdit
> frames collection object" />   <comClass
> clsid="{6c89906c-bf76-11e0-a394-005056c00008}"
> tlbid="{6c89905d-bf76-11e0-a394-005056c00008}"
> threadingModel="Apartment" progid="HccEditScripting.HccEditMinibuffer"
> description="HccEdit minibuffer object" />   <comClass
> clsid="{6c89906e-bf76-11e0-a394-005056c00008}"
> tlbid="{6c89905d-bf76-11e0-a394-005056c00008}"
> threadingModel="Apartment" progid="HccEditScripting.HccEditMenu"
> description="HccEdit menu object" />
>   <typelib tlbid="{6c89905d-bf76-11e0-a394-005056c00008}" version="1.0"
> helpdir="" flags="HASDISKIMAGE" />
> </file>
> </assembly>
>
>
>
> On 1/16/12, Jamal Mazrui<empower@xxxxxxxxx>  wrote:
>> I just noticed that both the CreateObject and CreateObjectEx functions
>> now include an optional last parameter that supports registration-free
>> COM.  For example, below is the documentation for CreateObjectEx.
>> Does anyone know of an example of using that parameter in a JAWS script?
>>   From my reading of MSDN, the syntax of such a manifest file is
>> complex and easy to get wrong, so a JAWS-oriented example would really
> help.
>> Jamal
>>
>> Function: CreateObjectEx
>> Description
>> In applications such as Internet Explorer or those found in Microsoft
>> Office, launches an application under the control of JAWS, which is
>> the automation object. The difference between CreateObject and
>> GetObject is that GetObject creates a pointer to an automation object
>> that already exists, whereas CreateObject creates the automation
>> object for the application.
>> Returns
>> Type: Object
>> Description: The automation object associated with the program.
>>
>> Parameters
>> Param 1:
>> Type: String
>> Description: Name of the COM class that can return an automation object.
>> Include: Required
>>
>> Param 2:
>> Type: Int
>> Description: TRUE = Same behavior as CreateObject. FALSE = Will always
>> force the use of CoCreateInstance instead of using GetObjectHelper
>> when JAWS is running as a service.
>> Include: Required
>>
>> Param 3:
>> Type: string
>> Description: name of the manifest file that contains the Registration
>> Free COM information or the name of a .dll with a manifest embedded as
>> a resource. Providing this parameter allows creation of an object that
>> hasn't been registered. This parameter is supported in JAWS 10.0 and
>> beyond More information can be found at http://msdn.microsoft.com by
>> searching for "Registration Free COM"
>> Include: Optional
>>
>> __________
>>
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
>>
>
> --
> Soronel Haetir
> soronel.haetir@xxxxxxxxx
> __________
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
>
> __________???
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
> --
> Doug Lee, Senior Accessibility Programmer SSB BART Group -
> Accessibility-on-Demand mailto:doug.lee@xxxxxxxxxxxxxxxx
> http://www.ssbbartgroup.com "While they were saying among themselves it
> cannot be done, it was done." --Helen Keller __________o?=
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
> __________�
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: