[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
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