Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » [OLEAutomation]retrieving data from a VT_ARRAY ([OLEAutomation]retrieving data from a VT_ARRAY)
[OLEAutomation]retrieving data from a VT_ARRAY [message #903383] Thu, 23 August 2012 12:50
Shailesh Charati is currently offline Shailesh CharatiFriend
Messages: 5
Registered: February 2011
Junior Member

I am calling following Visio API :

signature from typelib:
[id(0x600200b4), propget, helpcontext(0x00abda01)]
HRESULT MemberOfContainers([out, retval] SAFEARRAY(long)* pContainedByList);

Java wrapper for the same is :

public long[] MemberOfContainers() {
//Property Get
Variant varInputArray[] = new Variant[0];

Variant var = oleAutomation.getProperty(1610743988, varInputArray);

for (Variant _varItr : varInputArray) {
ISafeArrayService safeArrService = (ISafeArrayService) OSGIUtil.getService( Activator.getDefault(), ISafeArrayService.class );
ISafeArray _safeArr = safeArrService.createSafeArray(OLE.VT_I4, var.getByRef());
long[] returnValue = _safeArr.getLongArray();
return returnValue;


The variant "var" returned from oleAutomation.getProperty() call is of type 8195 i.e VT_ARRAY+VT_I4. I have tried to access the address of the array by calling var.getbyRef() and it returns "0".The getbyRef() method under variant is

public int /*long*/ getByRef() {
if (type == COM.VT_EMPTY) {
if ((type & COM.VT_BYREF)== COM.VT_BYREF) {
return byRefPtr;

return 0;

Any suggestion about how do I access the VT_ARRAY ? can we coerce it to VT_BYREF ?

Thanks in advance for your help.

Previous Topic:Adding other controls to a ToolBar
Next Topic:SWT and Java 7
Goto Forum:

Current Time: Wed Sep 23 06:30:39 GMT 2020

Powered by FUDForum. Page generated in 0.01925 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top