tags:

views:

399

answers:

2

I'm working with JIntegra java com bridge. I have an object of type Object which true coclass is unknown. I need to check if that object can be casted to specific COM interface (which has a proxy class generated by JIntegra).

A: 

If the proxy class implements a (generated) interface, can you check if the object is an instanceof that?

Chris Kimpton
No I can't, the generated proxy classes don't follow java conventions.In order to case an object from one interface to another, I need to do some thing like <br/>ISomeInterface = new ISomeInterfaceProxy(someObject); <br/>But this action fails on method invocation and not on creation.
Alex Shnayder
James Schek
+1  A: 

Call queryInterface() on the proxy. It should throw an exception if the underlying COM object does not implement the proxy interface.

James Schek