Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] ActiveX pointers to interfaces

I'm trying to use the Microsoft Office Chart 9.0 thru SWT's OLE interface.
Specifically, I'm trying to get/set the Border line style.  Chart 9.0 has
the following specs:

In the IDispatch interface there is a property:

	[id(0x0000138c), propget, helpcontext(0x0501a00e)]
	Border* Border();

Border is actually defined as an interface of Microsoft Office Pivot Table
9.0.  It looks like this:
	[
	  odl,
	  uuid(0FB45160-2DE7-11D1-B1CE-00A0C9056619),
	  helpcontext(0x06009000),
	  dual,
	  oleautomation
	]
	interface Border : IDispatch {
	    [id(0x60020000), propget, helpcontext(0x06009001)]
	    HRESULT Color([out, retval] VARIANT* Color);
	    [id(0x60020000), propput, helpcontext(0x06009001)]
	    HRESULT Color([in] VARIANT* Color);
	    [id(0x60020002), propget, helpcontext(0x06009003)]
	    HRESULT LineStyle([out, retval] VARIANT* LineStyle);
	    [id(0x60020002), propput, helpcontext(0x06009003)]
	    HRESULT LineStyle([in] LineStyleEnum LineStyle);
	    [id(0x60020004), propget, helpcontext(0x06009005)]
	    HRESULT Parent([out, retval] IDispatch** Parent);
	    [id(0x60020005), propget, helpcontext(0x06009006)]
	    HRESULT Weight([out, retval] VARIANT* LineWeight);
	    [id(0x60020005), propput, helpcontext(0x06009006)]
	    HRESULT Weight([in] LineWeightEnum LineWeight);
	};

As far as I can tell from the WordBase example, I should be able to do the
following to get/set the line style.

	OleClientSite clientSite = new OleClientSite(frame, SWT.NONE,
"OWC.Char");
	OleAutomation automation = new OleAutomation(clientSite);
	clientSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);

      int[] rgdispid = automation.getIDsOfNames(new String[]{"Border"});
      Variant result = automation.getProperty(rgdispid[0]);
      OleAutomation borderAuto = result.getAutomation();
                
      rgdispid = borderAuto.getIDsOfNames(new String[]{"LineStyle"}); 
      result = borderAuto.getProperty(rgdispid[0]);
      System.out.println("ERROR: " + borderAuto.getLastError());
      result = borderAuto.invoke(rgdispid[0], new Variant[] {new
Variant(4)});
      System.out.println("ERROR: " + borderAuto.getLastError());

      borderAuto.dispose();

The printlns show the following errors, both of which mean the method isn't
implemented in this interface.
	ERROR: OLE Automation Error Exception code = -2147467263 
	ERROR: OLE Automation Error HResult : -2147352573

The method is being found in borderAuto.getIDsOfNames, so what would be the
reason for these errors?

Thanks,
-Stephen

------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.




Back to the top