[jawsscripts] Re: Registration-free COM via CreateObject

  • From: "John Martyn" <johnrobertmartyn@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Tue, 17 Jan 2012 07:33:18 -0800

That part I do not know. I was using a 64 bit example, but it also worked on 32 
bit platforms.
John

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx 
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jamal Mazrui
Sent: Tuesday, January 17, 2012 6:54 AM
To: jawsscripts@xxxxxxxxxxxxx
Cc: Soronel Haetir
Subject: [jawsscripts] Re: Registration-free COM via CreateObject

Thanks for that example.  A few questions.  Is it a 64-bit COM server?  
Did you create that manifest manually or with a tool that generates it?  
Is there a free such tool?  By any chance, do you know whether the syntax would 
be different for a COM server built with .NET?  Lastly, is it possible to point 
the CreateObject function to a type library file
(.tlb) associated with the COM server rather than an XML manifest file?

Jamal

On 1/16/2012 12:51 PM, Soronel Haetir wrote:
> 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
>>
>>
>
__________ 

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: