Re: [dev] OLE, Source code generation and reflection ... the boring story ...

2007-10-09 Thread Stephan Bergmann

Marten Feldtmann wrote:

What a nonsense ... the BASIC program is the following and I think, that it
does pretty much the same as done in climaker 


IIRC, at least a long time ago there were problems with 
createTypeDescriptionEnumeration and particular arguments to it.  Did 
you experiment whether using other arguments (an explicit module name, 
an empty valueArray, 1 instead of -1) helps?  Sorry I cannot remember 
more details, or even an issue ID.


Either that, or some quirk of the Basic--UNO binding?

-Stephan


REM  *  BASIC  *

Sub Main
 MyReflectionTest
End Sub

Sub MyReflectionTest
 Dim oTypeDescriptionProvider as Object
 Dim enumeration as Object
 Dim typeDescription as object
 dim valueArray(0)  dim level

 valueArray(0) = com.sun.star.uno.TypeClass.SERVICE

 oTypeDescriptionProvider = CreateUnoService( 
com.sun.star.reflection.TypeDescriptionProvider )

 if not IsNull(oTypeDescriptionProvider) then
   enumeration = 
oTypeDescriptionProvider.createTypeDescriptionEnumeration(, 
valueArray,  -1)

   if not isNull(enumeration) then
 do while (enumeration.hasMoreElements)
   typeDescription = enumeration.nextTypeDescription
   MsgBox typeDescription.dbg_methodsloop

   endif
   endif

End Sub


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] OLE, Source code generation and reflection ... the boring story ...

2007-10-09 Thread Marten Feldtmann

Stephan Bergmann schrieb:

Marten Feldtmann wrote:
What a nonsense ... the BASIC program is the following and I think, 
that it

does pretty much the same as done in climaker 


IIRC, at least a long time ago there were problems with 
createTypeDescriptionEnumeration and particular arguments to it.  Did 
you experiment whether using other arguments (an explicit module name, 
an empty valueArray, 1 instead of -1) helps?  Sorry I cannot remember 
more details, or even an issue ID.




After asking google I found out, that such a discussion was hold around 
Juli 2005 with the same content between you and Arnulf Wiedemann. I'm just

reading it, what that all means ...

Marten

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] OLE, Source code generation and reflection ... the boring story ...

2007-10-09 Thread Marten Feldtmann
And Jürgen Schmidt answered this question around August-2005. Here is 
the corrected code

for the problem ..

Sub MyReflectionTest
 Dim enumeration as Object
 Dim typeDescription as object
 dim valueArray(0) 
 dim level


 valueArray(0) = com.sun.star.uno.TypeClass.SERVICE

 servicemgr = getProcessServiceManager()
 tdmgr = 
servicemgr.DefaultContext.getValueByName(/singletons/com.sun.star.reflection.theTypeDescriptionManager)

 if not IsNull(tdmgr) then
   enumeration = 
tdmgr.createTypeDescriptionEnumeration(com.sun.star.reflection, 
valueArray,  1)

   if not isNull(enumeration) then
 do while (enumeration.hasMoreElements)
   typeDescription = enumeration.nextTypeDescription
   MsgBox typeDescription.name 
 loop


   endif
  
 endif


End Sub

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] OLE, Source code generation and reflection ... the boring story ...

2007-10-07 Thread Marten Feldtmann

What a nonsense ... the BASIC program is the following and I think, that it
does pretty much the same as done in climaker 

REM  *  BASIC  *

Sub Main
 MyReflectionTest
End Sub

Sub MyReflectionTest
 Dim oTypeDescriptionProvider as Object
 Dim enumeration as Object
 Dim typeDescription as object
 dim valueArray(0) 
 dim level


 valueArray(0) = com.sun.star.uno.TypeClass.SERVICE

 oTypeDescriptionProvider = CreateUnoService( 
com.sun.star.reflection.TypeDescriptionProvider )

 if not IsNull(oTypeDescriptionProvider) then
   enumeration = 
oTypeDescriptionProvider.createTypeDescriptionEnumeration(, 
valueArray,  -1)

   if not isNull(enumeration) then
 do while (enumeration.hasMoreElements)
   typeDescription = enumeration.nextTypeDescription
   MsgBox typeDescription.dbg_methods   
 loop


   endif
  
 endif


End Sub

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] OLE, Source code generation and reflection ... the boring story ...

2007-10-06 Thread Marten Feldtmann

if you want to programmatically determine all types, you could use the
com.sun.star.comp.stoc.RegistryTypeDescriptionProvider service.

For example the climaker uses it to create all cli types from UNO 
types. Have a look at cli_ure/source/climaker/climaker_app.cxx.


Eventually 
com.sun.star.reflection.XTypeDescriptionEnumeration.nextTypeDescription()

is used to iterate over all available types.

Yes, I tried that - but all I get are empty enumerations ... as an 
example an OOBASIC code trying to get

all services from the reflection module ...


REM Smalltalk Source code example 
REM typeCollection := OrderedCollection new.
REMtypeCollection add: OOCSSUnoTypeClass::SERVICE.
REMenumeration := anInstance
REMcreateTypeDescriptionEnumeration: 
'com.sun.star.reflection' 
REMtypes: (OSVariantarg 
fromIntegerCollection: typeCollection)
REMdepth: 
OOCSSReflectionTypeDescriptionSearchDepth::INFINITE .

REMaCollection := OrderedCollection new.
REM[ enumeration hasMoreElements ] whileTrue:[
REMaCollection add: enumeration nextTypeDescription   
REM].

REMaCollection

Sub MyReflectionTest
 Dim oTypeDescriptionProvider as Object
 Dim enumeration as Object
 Dim typeDescription as object
 dim valueArray(0) 


 valueArray(0) = com.sun.star.uno.TypeClass.SERVICE

 oTypeDescriptionProvider = CreateUnoService( 
com.sun.star.reflection.XTypeDescriptionEnumeration )

 if not IsNull(oTypeDescriptionProvider) then
   enumeration = 
oTypeDescriptionProvider.createTypeDescriptionEnumeration(com.sun.star.reflection, 
valueArray, -1)

   if not isNull(enumeration) then
 do while (enumeration.hasMoreElements)
   typeDescription = enumeration.nextTypeDescription
   MsgBox typeDescription.dbg_methods   
 loop


   endif
  
 endif


End Sub


Marten




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] OLE, Source code generation and reflection ... the boring story ...

2007-10-02 Thread Joachim Lingner

If you want to programmatically determine all types, you could use
the
com.sun.star.comp.stoc.RegistryTypeDescriptionProvider service.

For example the climaker uses it to create all cli types from UNO types. 
Have a look at cli_ure/source/climaker/climaker_app.cxx.


Eventually 
com.sun.star.reflection.XTypeDescriptionEnumeration.nextTypeDescription()


is used to iterate over all available types.


Hope that helps,
Joachim


Marten Feldtmann wrote:


I'm still on a rather boring project here (actually I worked for this 
last year
also but stopped that working and now I'm looking at that problem again) 
...

I try to connect VASmalltalk to OpenOffice via OLE. My approach was to get
all the information from OpenOffice via reflection and then I try to 
produce Smalltalk
code, which can be pretty nice used to do OpenOffice programming at 
least under

Windows using OLE.

One of my first problems to get a list of all services, constants, enum 
etc ... there is
simply no way to get this via software control. Therefore I installed 
the SDK and
parsed all files below the directory classes and I got a list with 
more than 3000
items - fine. Via this method and some reflection I get around 176 
definitions for

enums, constants and so on.

Then I tried to get information about services and interfaces, but this 
sometimes

has success (e.g 'com.sun.star.chart2.Title'), but sometimes not a single
information can be retrieved (e.g. ''com.sun.star.chart2.DataPoint''). 
In the

later case I always get VtUnknown error from the OLE subsystem.

My attempts to get more meta information is either via the core reflection
service or via an instance via beans.introspection  but both classes 
can not

deliver valid informations on most interfaces and services.

Any idea how what the problem can be 


Marten




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]