Reflection always returns typename as com.sun.star.uno.XInterface

asked 2017-08-30 01:48:51 +0200

Zev Spitz gravatar image

The following lines of Javascript, running under CScript on Windows 10 Professional (LibreOffice 5.3.4.2) always outputs com.sun.star.uno.XInterface, no matter what object I pass to the getType method:

var objServiceManager = new ActiveXObject('com.sun.star.ServiceManager');
var objDesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop");
var objDocument = objDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, []);
var objCoreReflection = objServiceManager.createInstance("com.sun.star.reflection.CoreReflection");
var classInfo = objCoreReflection.getType(objDocument);
WScript.Echo(classInfo.getName());
classInfo = objCoreReflection.getType(objDesktop);
WScript.Echo(classInfo.getName());
// outputs twice com.sun.star.uno.XInterface

How can I find out the actual type?

edit retag flag offensive close merge delete