Re: Creating event objects
Robert Hastings <[email protected]>
| Newsgroups | gmane.comp.windows.devel.jawin |
|---|---|
| Message-ID | <003c01c46e05$cc831110$6f00a8c0@seraph> |
Hi John, I'm afraid jawin does not currently support event sinking. I'm actually on the hook for an implementation. Unfortunately, the implementation I did for jSegue is based on the fact that event sinks are normally IDispatch based. Event sinks are exactly opposite of what jawin normally does. I've implemented some event sinks for other projects by hand so I can give you some info on how it could be done. We'd need to generate a C++ class that implements MbtQuotesNotify. Then each method would have to use JNI to call a java method. The constructor of the C++ class should be passed the jobject global ref to the java object that will be the sink. In a less general case you could make the C++ side call a static method and then have the static method route to the correct java method to handle the event. Robert. ----- Original Message ----- From: "John Pompeii" <[email protected]> To: <[email protected]> Sent: Monday, July 19, 2004 7:32 PM Subject: Re: [JAWIN] Creating event objects > ....some more detail: > > The MbtQuotesNotify is derived from IUknown which I guess explains why this > class was generated differently then the rest (than those dervied from > IDispatch): > > [ > odl, > uuid(C8323838-B094-4E3C-B9BE-D08B5C06E6BE), > helpstring("IMbtQuotesNotify Interface"), > oleautomation > ] > interface IMbtQuotesNotify : IUnknown { > HRESULT _stdcall OnQuoteData([in] QUOTERECORD* pQuote); > HRESULT _stdcall OnLevel2Data([in] LEVEL2RECORD* pRec); > HRESULT _stdcall OnTSData([in] TSRECORD* pRec); > HRESULT _stdcall OnOptionsData([in] OPTIONSRECORD* pRec); > }; > > So I guess the question is how to create instances of IUnknown-derived > classes? > > On one other point, using a C++ sample program for the Com classes I'm > using, the constructor of the C++ MbtQuotesNotify class invokes: > > EnableAutomation(); // Enable OLE automation > > Is there something equivalent I need to do? > > Also, please pardon the ignorance about COM. I've managed to avoid this > stuff my whole career, but I do have a pretty solid background in java, > C++, CORBA, etc. > > thanks, > --john >