tags:

views:

54

answers:

3

I'm a complete newbie to Windows and COM programming, trying to use com4j in order to call a COM object from Java.

Com4j generates Java interfaces from COM definitions "often found in .ocx, .dll, .exe, and/or .tlb files" . It was easy for me to locate the .ocx file of my target COM object, but I have no clue regarding the standard interface iStream.

Microsoft's documentation mentions OLE32.DLL ( c:\Windows\Windows32\Ole32.dll ?) , but neither the com4j generator nor oleviewer succeed in opening this file.

Any hints?

+1  A: 

The documentation you linked to references Objidl.idl. com4j might be able to process IDL files.

Alternatively you could try compiling the IDL into a TLB using MIDL: http://msdn.microsoft.com/en-us/library/aa367372(VS.85).aspx

Daniel Renshaw
Any idea where I can find objidl.idl?
Youval Bronicki
It's part of the Windows Platform SDK but if you have Visual Studio or VC++ installed, you robably have it too. On my machine I found mulitple versions rooted at C:\Program Files (x86)\Microsoft SDKs\Windows\.
Daniel Renshaw
+1  A: 

It looks like it is defined in comsvcs.dll .

gpvos
The DLL seems right. Unfortunately, com4j failed to generate interfaces from it. I'm looking for answers.
Youval Bronicki