Mailing List Archive

Event in COM
This is a multi-part message in MIME format.
--------------FFAE3A6B1BF931FD6086BAC9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

Can anyone show me some code or recommend me a book for this problem?
I look through the newsgroup and tried to read the source, but I cannot
figuire it out. (Thanks in Adv)
I am trying to write an event handler for a ocx control that receives
real time data. Obviously, I cannot retrieve anything without event
handelers.
after following:
>> import win32com.client
>> rR = win32com.client.Dispatch('RTLIST.RTList')

----
Obvious place for me to do this is at
gen_py/xxxxxxx-0900000--33242432.py (something like it)
by uncommenting those lines and writing it in, but I would like to write
a class by inheriting it and overwriting it and keep these things
general as possible.

class _DRTListEvents:
"Xyris RTList Control events"
CLSID = pythoncom.MakeIID('{122B0CF2-C843-11CF-8925-00AA00575EBE}')
_public_methods_ = [] # For COM Server support
_dispid_to_func_ = {
3 : "OnChangeEx",
4 : "OnErrorEx",
1 : "OnSnapComplete",
2 : "OnChange",
5 : "OnChangeVnt",
}

def __init__(self, oobj = None):
pass
def _query_interface_(self, iid):
import win32com.server.util
if iid==self.CLSID: return win32com.server.util.wrap(self)

# Handlers for the control
# If you create handlers, they should have the following prototypes:
# def OnChangeEx(self, ItemIndex=defaultNamedNotOptArg,
ItemName=defaultNamedNotOptArg, ItemValue=defaultNamedNotOptArg,
ItemStatus=defaultNamedNotOptArg, ChangeType=defaultNamedNotOptArg):
# "Occurs whenever real-time update is made to an item in the list"
# def OnErrorEx(self, ErrorCode=defaultNamedNotOptArg):
# "Occurs when RTList experiences an error communicating with the
real-time data source"


Help!

--
*****************************************************************************
S. Hoon Yoon (Quant) Merrill Lynch Equity Trading,
yelled@yahoo.com hoon@bigfoot.com(w)
"Miracle is always only few standard deviations away, but so is
catastrophe."
* Expressed opinions are often my own, but NOT my employer's.
"I feel like a fugitive from the law of averages." Mauldin
*****************************************************************************
--------------FFAE3A6B1BF931FD6086BAC9
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Hoon Yoon
Content-Disposition: attachment; filename="vcard.vcf"

begin: vcard
fn: Hoon Yoon
n: ;Hoon Yoon
email;internet: hyoon@bigfoot.com
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard


--------------FFAE3A6B1BF931FD6086BAC9--
Event in COM [ In reply to ]
You can only get events from an OCX by using code from within Pythonwin.

You can subclass from the generated code.

You should check out the Pythonwin demos. Depending on the version you
have, these will be either in "pywin\Demos" or "pywin\Demos\ocx". You
should look for "ocxserialtest.py", "ocxtest.py", "webbrowser.py" and a
later one "msoffice.py"

Mark.

Hoon Yoon wrote in message <3713C3A5.59CB36E5@bigfoot.com>...
>Hi,
>
> Can anyone show me some code or recommend me a book for this problem?
>I look through the newsgroup and tried to read the source, but I cannot
>figuire it out. (Thanks in Adv)
> I am trying to write an event handler for a ocx control that receives
>real time data. Obviously, I cannot retrieve anything without event
>handelers.