Book a Demo

Author Topic: Importing Automation Objects/Type Libraries  (Read 4905 times)

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Importing Automation Objects/Type Libraries
« on: September 25, 2002, 08:05:21 am »
I am creating a Visual Basic application which uses the automation interface of another program. In Visual Basic I can add a reference to the type library (TLB file) that describes the automation object. Then VB will recognize the object and all of its attributes and operations.

I would like to somehow import this information into EA, so that I can model how my own objects interface to the automation object. But I can't find any way to import TLB, OCX and such files into EA.

I have used the Visual C++ Class wizard to create a wrapper class header file, which i can then import into EA, but that one is full of C++ language. And in this specific case I would prefer VB code.

Does anyone know a clever way of going about this problem?

Darren Lock

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
    • View Profile
Re: Importing Automation Objects/Type Libraries
« Reply #1 on: October 03, 2002, 01:05:07 am »
EA does not have a dual interface. That is, it only supports IDispatch not direct vtable access. This means that all calls are late bound (i.e. IDispatch queries the object at runtime to see if it supports the method/property by name rather than by ID as would be the case with early binding). Geoff has responded in earlier posts to hint that an early bound (typelib) version will be available in the future. One of the problems with late bound (depending on how good or bad a programmer your are!) is that any errors (mis-spelt methods, etc) are not detected until run time. You can offset this by creating a COM object or class to wrap EA with all the appropriate error checking and then call that from you program (early bound) instead. This is quite a lot of work, especially if an early bound interface is imminent.

Darren
Darren Lock
United Kingdom

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Re: Importing Automation Objects/Type Libraries
« Reply #2 on: October 03, 2002, 05:46:22 am »
Thanks Darren, for your reply.

My main objective at the moment was to include the interaction between my application and external COM objects in the model/documentation. Therefore I would have liked to be able to import the class definitions, so I wouldn't have to type them all in EA.

I got this reply from Sparks by mail:

---------------------
Hello Mikkel,

We are looking at IDL, Corba, Type Libraries etc. after the version 3.50 release
is  complete  (mid  to  late  October) ... so I would expect that facility to be
there by the end of this year,

Best regards,
Geoffrey Sparks
----------------

Mikkel