From: SourceForge.net <no...@so...> - 2006-09-27 09:47:53
|
Bugs item #1068288, was opened at 2004-11-17 16:42 Message generated for change (Comment added) made by bigrixx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=1068288&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Classes Group: None >Status: Pending >Resolution: Fixed Priority: 5 Submitted By: Rony G. Flatscher (orexx) Assigned to: Nobody/Anonymous (nobody) Summary: OLEObject-event not invoked! Initial Comment: Working with an ActiveX control to drive the TWAIN interface (cameras, scanners, etc.) using a great product (test-version available) from Vintasoft corp. <http://www.vintasoft.com> reveals the phenomenon that the event "PostEvent" (indicating scanning/acquiring is over and result fully available) is not invoked by Object Rexx. It works with all other products (MS Office) and languages (VB, C, C++, ...). Accompanying file contains the (very short) Rexx program ("simpleWithEvent.rex") with a subclass of OLEObject possessing the event-handling method. If you download the demo-package from <http://www.vintasoft.com> and install it, you can test for yourself. [There is a version of the Rexx program ("simple.rex") in the package, demonstrating how one could acquire via the Twain interface without an event callback.] ---------------------------------------------------------------------- >Comment By: Rick McGuire (bigrixx) Date: 2006-09-27 05:47 Message: Logged In: YES user_id=1125291 Thanks again to Mark Miesfeld. ---------------------------------------------------------------------- Comment By: Mark Miesfeld (miesfeld) Date: 2006-09-25 20:32 Message: Logged In: YES user_id=191588 I have submitted patch # 1565431 that fixes this bug. A few words about the bug. For one thing, the bug affected not just the Vintasoft ActiveX control but also a number of other OLE / COM objects, most notably Microsoft Word. It is interesting to note this: apparently several years ago Lee Pendin opened up a bug with IBM for events not being supported with the Micosoft ControlAgent. IBM fixed the bug by special casing the ControlAgent. From the code: else if (IsEqualIID(riid, DIID__AgentEvents)) /* special handling for Microsoft ControlAgent */ /* The agent do not ask for the dynamic IDispatch interface, but for it's own special one */ /* which is in reality a IDispatch interface. Thats the reason why here is checked for the */ /* control agenst query and the Interface is returned */ Well, obviously ooRexx can not special case an object every time a new one is discovered. The fix is to reply in a generic way to the query interface from connectable objects. ooRexx already, in the OLEObject code, goes to some length to determine exactly which interface is the outgoing event interface for the OLE / COM object being proxied. Unfortunately, once the proper IID was determined, it was discarded. This fix passes the IID on to the OLEObjectEvent object. The event object instance saves the IID and then returns true if queried about supporting that interface. This is the correct behavior, because the event list for this OLEObjectEvent instance has been dervied from exactly that interface. With the fix, the special case for the Microsoft ControlAgent is removed. Rony and I have been testing this for several weeks. All the COM objects where events used to work, (IE, Excel, and Outlook) still work. And, in addition, the Vintsoft, Word, and ControlAgent also work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684730&aid=1068288&group_id=119701 |