Generating Excel Wrapper using AX Component Wizard

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Generating Excel Wrapper using AX Component Wizard

GallegO-2
Hi!

I'm trying to generate an Excel_Application wrapper using the component
wizard.
My problem is that the Type Analyzer generates Excel_Application as a
dual interface wrapper but, by example #range:cell2: (auto generated)
answers ExcelRange which actually is a disp interface, but I'm expecting
an ExcelIRange here ( IRange, the dual interface).
1. How I can convert from the returned type ExcelRange to ExcelIRange?
2. Why AXTypeLibraryAnalyzer forces the generation of the dual interface
not allowing to choose generate disp interfaces? (and then we do not
worry about use the ugly #visible:rhs: )

Thanks in advance.

Jose Sebastian Calvo


Reply | Threaded
Open this post in threaded view
|

Re: Generating Excel Wrapper using AX Component Wizard

GallegO-2
Jose Sebastian Calvo wrote:
> 2. Why AXTypeLibraryAnalyzer forces the generation of the dual interface
> not allowing to choose generate disp interfaces? (and then we do not
> worry about use the ugly #visible:rhs: )

Answering myself

modifying 2 methods I can generate Dispatch interfaces for
Excel_Application, Excel_Workbook, etc that in other case would be
generated as Dual interfaces.
This solves for me the ugly #xxxXXx:rhs: protocol.
The generation process is:
1- Start with a clean image.
2- File-in the attached methods (at the end)
3- Open the Active-X Component Wizard and generate the Excel Wrapper
4- Save the Excel, VBIDE, and Office generated packages and discard the
image
5- Install the generated packages in a new Image

Cheers
Jose Sebastian Calvo
------------------------------------------------------------------
!AXTypeLibraryAnalyzer methodsFor!

buildTypeAnalyzers
        "Private - Build the collection of <AXTypeInfoAnalyzers> which describe
the types in the receiver."

        | count lib |
        count := self typeInfoCount.
        lib := self tlbInterface.
        typeAnalyzers := (1 to: count) collect:
                                        [:i |
                                        AXTypeInfoAnalyzer
                                                onTypeInfo: (lib typeInfoAt: i) "asImplType"
                                                typeLib: self
                                                index: i]! !
!AXTypeLibraryAnalyzer categoriesFor:
#buildTypeAnalyzers!accessing!private! !


!TKindDispatchAnalyzer methodsFor!

superInterface
        "Answer the a <TKindInterfaceAnalyzer> describing the <COMInterface>
        from which the receiver is derived, or nil if the receiver describes
IUnknown."

        ^"self isDual
                ifTrue: [self dualInterface superInterface]
                ifFalse: ["super superInterface"]"! !
!TKindDispatchAnalyzer categoriesFor: #superInterface!enumerating!public! !