Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] Question using ActiveX Support of SWT

I have added:
         Variant.setByRef(int)
         Variant.setByRef(short)
         Variant.setByRef(float)
         Variant.setByRef(boolean)

This is currently available in HEAD and will be available in RC1 of R2.1.





Veronika Irvine/Ottawa/IBM@IBMCA
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
02/18/2003 09:13 AM
Please respond to platform-swt-dev

 
        To:     platform-swt-dev@xxxxxxxxxxx
        cc: 
        Subject:        RE: [platform-swt-dev] Question using ActiveX Support of SWT


1) Yes this technique also works for byRef arguments in OleAutomation - it 

works anywhere you have a Variant object.
2) The likelihood is very low.  Unfortunately this is currently the only 
way to get and set byRef data.  Variant has many different types and 
combinations of types and I just haven't had time to implement a nice Java 

API to access them all yet.
3) I will spend some time looking at this again for R2.1 to come up some 
reasonable API.  A ByRef API for getting and setting simple types should 
be fairly easy to whip up : ) but time is running out for R2.1 ...






Ron Baldwin <ron.baldwin@xxxxxxxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
02/18/2003 05:24 AM
Please respond to platform-swt-dev

 
        To:     "'platform-swt-dev@xxxxxxxxxxx'" 
<platform-swt-dev@xxxxxxxxxxx>
        cc: 
        Subject:        RE: [platform-swt-dev] Question using ActiveX 
Support of SWT


I assume that since you used COM (an internal class), that there isn't a
"supported" way of doing this.  A few questions:

1. Does this technique also work for byref arguments of methods on the
default interface (OleAutomation)?
2. What is the likelihood of the users of this technique getting nailed
later on by a change in the internal classes?
3. What is the likelihood/priority of this functionality being added to 
the
public API?

Ron

> -----Original Message-----
> From: Veronika_Irvine@xxxxxxxxxx [mailto:Veronika_Irvine@xxxxxxxxxx]
> Sent: Monday, February 17, 2003 8:41 AM
> To: platform-swt-dev@xxxxxxxxxxx
> Subject: Re: [platform-swt-dev] Question using ActiveX Support of SWT
> 
> 
> oleControlSite.addEventListener(BEFORE_NAVIGATE2, new OleListener() {
>         public void handleEvent(OleEvent event) {
>                 if (event.type != BEFORE_NAVIGATE2) return;
>                 Variant url = event.arguments[1];
>                 if (url.getString() != null) {
>                         NavigationEvent ne = new NavigationEvent();
>                         ne.setUrl(url.getString());
>                         ne.setCancel(false);
>                         eventBeforeNavigate(ne);
>                         if(ne.isCancel()) {
>                                 System.out.println("Cancel 
> navigation!");
>                                 Variant cancel = event.arguments[6];
>                                 int ptr = cancel.getByRef();
>                                 COM.MoveMemory(ptr, new 
> int[]{COM.VARIANT_TRUE}, 4);
>                                 stop();
>                         }
>                  }
>         }
> });
> 
> 
> 
> 
> 
> "Dein, Christian (empolis KL)" <Christian.Dein@xxxxxxxxxxx>
> Sent by: platform-swt-dev-admin@xxxxxxxxxxx
> 02/17/2003 06:33 AM
> Please respond to platform-swt-dev
> 
> 
>         To:     "'platform-swt-dev@xxxxxxxxxxx'" 
> <platform-swt-dev@xxxxxxxxxxx>
>         cc: 
>         Subject:        [platform-swt-dev] Question using 
> ActiveX Support of SWT
> 
> 
> Hello everybody,
> i'm Christian Dein Professional Services of empolis GmbH
> (http://www.empolis.com).
> 
> I have a question by using the ActiveX Support of the Eclipse SWT 
> Framework.
> How could I set values of a Variant which is basically a 
> ByRef argument of
> an OleEvent?
> 
>  oleControlSite.addEventListener(BEFORE_NAVIGATE2, new
> OleListener() {
>                                                  public void 
> handleEvent(OleEvent event) {
>                                                                  if 
> (event.type != BEFORE_NAVIGATE2)
>   return;
> 
>    Variant 
> url = event.arguments[1];
>                                                                  if 
> (url.getString() != null) {
>   NavigationEvent ne = new
> NavigationEvent();
>   ne.setUrl(url.getString());
>   ne.setCancel(false);
>   eventBeforeNavigate(ne);
>   if(ne.isCancel()) {
>                  System.out.println("Cancel
> navigation!");
>                  Variant cancel = new
> Variant(event.arguments[6].getByRef(), (short)(OLE.VT_BYREF | 
> OLE.VT_BOOL));
> 
> System.out.println(cancel.getBoolean());
>                  stop();
>   }
>                                                                  }
>                                                  }
>                                  });
> 
> Thank you for your help!
> Best regards
> Christian
> 
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/platform-swt-dev
> 
> 
> 
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/platform-swt-dev
> 
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev





Back to the top