|
| Defining a Class for an activex/Ocx |
| Iniciado por guest, 21,sep. 2012 00:31 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 21,septiembre 2012 - 00:31 |
Hi,
I was thinking about writing a class for my spread control (that I use a lot) - so I could reuse it several times in the same project and in other projects without copy/paste of code, just the class. - But one question raises before I even coded 1 char
How do a class hande events ?
say I have an event like:
ActiveXEvent(RowMove,fpsL,"LeaveCell")
Now I want the code for the derived class to get the event, and run ClassName.rowMove method. - Is this possible or just a dream
Second I would like the class to hold the definitions of all the:
ActiveXEvent(METHODS,ClassName,SPREAD:EVENTS) ActiveXEvent(METHODS,ClassName,SPREAD:EVENTS)
Is this possible ?
Cheers Tor-Bjarne |
| |
| |
| | | |
|
| | |
| |
| Publicado el 20,marzo 2015 - 15:05 |
Hi, I have the same problem!! I've tried to use ActiveXEvent(method, control, eventmessage) in the contructor of the object, but it doesn't work. For example, when the event "ClickCell" on the Spread Control occurs, it generates this error:
What happened? Call to 'Method #ClickCell' method of already freed instance.
Thanks
Danilo |
| |
| |
| | | |
|
| | |
| |
| Publicado el 20,marzo 2015 - 15:31 |
I resume this post because I'm actually trying to do the same thing with no success.
I defined a "Grid" class to handle the grid activex and while calling a method of the class or reading/writing properties of the class has real effect on the activex grid I don't know how to trap and handle events from the class. The aim is to: 1) auto-handle some events through the class without writing a single line of code in the program that creates and uses the instances of the class EX: If you click on column header you get the overall column selected.. This code should not be written in the main program but the action should be triggered automatically from the class 2) define custom events raised by the class depending on activex inner events EX: Create an event "aspectchanged" raised from every native event regarding aspect modifications of the grid (colmove, colwidthchange, ecc..)
I want the main program talk with only the class, not directly with the activex grid. So if I define 4 grids in a form I can handle them with 4 instances of Grid class... but I need to trigger also their events.... |
| |
| |
| | | |
|
| | | | |
| | |
|