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 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
> 


Back to the top