views:

54

answers:

2

I want to call an ActiveX DLL or OLE2 object from ABAP.

I already know the syntax of how to instantiate the object & execute the methods:

data: my_object type ole2_object.

create object my_object <ole2object>.

call method of my_object <objectmethod>.

But given a particular application, how do I know if this is supported, what the values/names of ole2object and objectmethod is?

Transaction SOLE supplies a table of OLE Applications, among this is Excel.Application which I know can be instantiated as an OLE object, so it looks like you have to add the OLE2 app to this table first, but once again where can I read the data like CLSID & LibType from - is it published as part of the application?

+1  A: 

In this case, you're simply using OLE2 to access a COM interface. If you're into accessing Office applications, you might want to take a look at KB222101. For other applications and libraries, you'll need the API documentation, some suitable examples (not necessarily in ABAP, VB will do just fine). a pointed stick to poke the developer with or all three of them...

Oh, and there's a tool called OLE/COM Object Explorer by MiTeC that can be downloaded for free from their website. Haven't used it myself, but it looks like it might be helpful.

vwegert
Hi vwegert, thanks for your answer. Mind if I use the pointed stick on security drones that believe developers can't be trusted to have local admin rights on their work PC?
Esti
@Esti: Go right ahead - and don't forget to use the blunt end of the stick to beat those developers into unconsciousness who write applications that require admin rights on the local PC to run at all...
vwegert
Accepted this answer for the reference to MiTeC's OLE/COM browser, this has been the most helpful tool so far. I've previously tried Microsoft's OLE/COM browser but it was buggy on the newer versions of Windows.
Esti
+2  A: 

Hello,

Objects are coming from the table TOLE. Their methods and propeties are stored into table OLELOAD.

I found some time ago somes documents (this one and this one) that contained indications of how you can find the properties and methods.

Indication on the CLSID are succint, but it seems to be the value in the register with HKEY_CLASS_ROOt/CLSID that goes with the application indicated (ie VISIO.APPLICATION for exemple). If you search this application value with regedit, you'll find the corresponding CLSID.

Hope it's helping
Guillaume

PATRY
Thanks for your answer PATRY
Esti