Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ActiveX and return class
ActiveX and return class [message #444571] Fri, 15 October 2004 04:39 Go to next message
Vitali is currently offline VitaliFriend
Messages: 2
Registered: July 2009
Junior Member
I'm wondering how I would go about getting the object provided by a
listener to a OleControl object.

public void handleEvent (OleEvent event)
{
if (event.type == DOUBLE_CLK)
{
Variant args = event.arguments[0];
if (args == null) return;
/*What do i do?*/
}
}

How do I get the _OnAlertSelectedEvent e which is provided by this event?
And how would I get it's fields.
Re: ActiveX and return class [message #444578 is a reply to message #444571] Fri, 15 October 2004 13:32 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
What does the type library info for the DOUBLE_CLK event for this particular
control look like?

"Vitali" <vlovich@spymac.com> wrote in message
news:opsfv9vfd6p9udmp@superspeedy.spuc...
> I'm wondering how I would go about getting the object provided by a
> listener to a OleControl object.
>
> public void handleEvent (OleEvent event)
> {
> if (event.type == DOUBLE_CLK)
> {
> Variant args = event.arguments[0];
> if (args == null) return;
> /*What do i do?*/
> }
> }
>
> How do I get the _OnAlertSelectedEvent e which is provided by this event?
> And how would I get it's fields.
Re: ActiveX and return class [message #444590 is a reply to message #444578] Fri, 15 October 2004 16:05 Go to previous messageGo to next message
Vitali is currently offline VitaliFriend
Messages: 2
Registered: July 2009
Junior Member
I'm not sure what you mean by that. I don't have the source to the
activex control and the documentation is pretty sparse.
I figured out what the int for the event type by just adding event
listeners for events 0 - 1000, and 50 is the one that occurs when a user
double clicks.

In CPP or C# the event handler is a callback which is passed LPDISPATCH
(in the example called Alert).

HRESULT hr = Alert->QueryInterface( IID_IAlertData,(void**)&myalert);

IID_IAlertData is something imported from an ocx file and myalert is a
pointer to the proper class type (probably also imported from the ocx file.

On Fri, 15 Oct 2004 09:32:00 -0400, Veronika Irvine
<veronika_irvine@oti.com> wrote:

> What does the type library info for the DOUBLE_CLK event for this
> particular
> control look like?
>
> "Vitali" <vlovich@spymac.com> wrote in message
> news:opsfv9vfd6p9udmp@superspeedy.spuc...
>> I'm wondering how I would go about getting the object provided by a
>> listener to a OleControl object.
>>
>> public void handleEvent (OleEvent event)
>> {
>> if (event.type == DOUBLE_CLK)
>> {
>> Variant args = event.arguments[0];
>> if (args == null) return;
>> /*What do i do?*/
>> }
>> }
>>
>> How do I get the _OnAlertSelectedEvent e which is provided by this
>> event?
>> And how would I get it's fields.
>
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Re: ActiveX and return class [message #444597 is a reply to message #444590] Fri, 15 October 2004 18:50 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
You could try:

public void handleEvent (OleEvent event)
{
if (event.type == DOUBLE_CLK)
{
Variant arg1 = event.arguments[0];
if (arg1 == null) return;
if (arg1.getType() == OLE.VT_DISPATCH) {
OleAutomation auto = arg1.getAutomation();
... use the automation object to do whatever it is you
want to do, you need to find out what methods are available on it
auto.dispose();
}
arg1.dispose();
}
}

"Vitali" <vlovich@spymac.com> wrote in message
news:opsfw5m1lkp9udmp@superspeedy.spuc...
> I'm not sure what you mean by that. I don't have the source to the
> activex control and the documentation is pretty sparse.
> I figured out what the int for the event type by just adding event
> listeners for events 0 - 1000, and 50 is the one that occurs when a user
> double clicks.
>
> In CPP or C# the event handler is a callback which is passed LPDISPATCH
> (in the example called Alert).
>
> HRESULT hr = Alert->QueryInterface( IID_IAlertData,(void**)&myalert);
>
> IID_IAlertData is something imported from an ocx file and myalert is a
> pointer to the proper class type (probably also imported from the ocx
> file.
>
> On Fri, 15 Oct 2004 09:32:00 -0400, Veronika Irvine
> <veronika_irvine@oti.com> wrote:
>
>> What does the type library info for the DOUBLE_CLK event for this
>> particular
>> control look like?
>>
>> "Vitali" <vlovich@spymac.com> wrote in message
>> news:opsfv9vfd6p9udmp@superspeedy.spuc...
>>> I'm wondering how I would go about getting the object provided by a
>>> listener to a OleControl object.
>>>
>>> public void handleEvent (OleEvent event)
>>> {
>>> if (event.type == DOUBLE_CLK)
>>> {
>>> Variant args = event.arguments[0];
>>> if (args == null) return;
>>> /*What do i do?*/
>>> }
>>> }
>>>
>>> How do I get the _OnAlertSelectedEvent e which is provided by this
>>> event?
>>> And how would I get it's fields.
>>
>>
>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Previous Topic:Reordering Table Columns in Carbon
Next Topic:Need a cross-platform example
Goto Forum:
  


Current Time: Sat Oct 24 04:35:52 GMT 2020

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

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

Back to the top