Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

ActiveX events broken

axtivex com events datagrid

  • Please log in to reply
No replies to this topic

#1 Heron

Heron

    Seeker

  • Active Members
  • 43 posts

Posted 13 November 2011 - 12:25 AM

Hi AutoIt nerds,

who can help me out with this issue? It is driving me nuts.
I found a great activeX control, MSTgrid, that is much easier for me than listview with all the options I need. However there's a strange thing going on. I have bound to the control to receive its events and it does so as expected BUT... the precise moment I enter a key when in the edit mode of a cell all of the events stop firing from then on. And it doesn't start again either when out of the edit mode.
The same control bound to VB or to Excel works as expected and gives events like KeyPressEdit and ChangeEdit and so on. I have no clue as why AutoIt behaves different.
Below a sample script and the free control to download (which has to be installed of course).

Plain Text         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=D:\nlrgo\My Documents\My AutoIt Scripts\SQList2\datagrid.kxf $Form1 = GUICreate("Form1", 719, 451, 228, 124, BitOR($WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_CLIPCHILDREN,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_Close") $Obj1 = ObjCreate("MstGrid.grdView") $Obj1_ctrl = GUICtrlCreateObj($Obj1, 10, 10, 500, 300) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Event = ObjEvent($Obj1, "MSTEvent_") $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Func MSTEvent_($ev) ConsoleWrite("Event: " & $ev & @CRLF) EndFunc Func Form1_Close() Exit EndFunc Func MyErrFunc()   Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"    & @CRLF  & @CRLF & _              "err.description is: " & @TAB & $oMyError.description  & @CRLF & _              "err.windescription:"   & @TAB & $oMyError.windescription & @CRLF & _              "err.number is: "       & @TAB & hex($oMyError.number,8)  & @CRLF & _              "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _              "err.scriptline is: "   & @TAB & $oMyError.scriptline   & @CRLF & _              "err.source is: "       & @TAB & $oMyError.source       & @CRLF & _              "err.helpfile is: "       & @TAB & $oMyError.helpfile     & @CRLF & _              "err.helpcontext is: " & @TAB & $oMyError.helpcontext _             ) EndFunc While True Sleep(100) WEnd


It seems that I cannot attache the control but you can download it from everywhere.

Thanks!










0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users