SysRefresh() ( DO Events) / MsgInfo() and ActiveX()

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

SysRefresh() ( DO Events) / MsgInfo() and ActiveX()

Post by Jimmy »

hi,

based on CLASS Tvlc from carlos vargas
https://forums.fivetechsupport.com/viewtopic.php?t=36205

i wrote CLASS FWTVlc which include Codeblock Slot for Events and Menu
https://forums.fivetechsupport.com/viewtopic.php?t=42025

Code: Select all | Expand

     // ActiveX have no Property bRClicked so ADD it
      ::bRClicked = { | nRow, nCol | VLC_Menu( oWnd, nRow, nCol, ::oControl, ::nIndex ) }


i have try Method VLC_Menu() but it "hang" so i use Function VLC_Menu()

Code: Select all | Expand

FUNCTION VLC_Menu( oDlg, nRow, nCol, oVLCX, nIndex )
LOCAL oPopup
LOCAL lisObj := .F.

   DEFAULT nIndex TO 1

   IF hb_isObject( oVLCX )
      lisObj := .T.

      MENU oPopup POPUP
         MENUITEM "&POPUP Menu" ACTION MsgInfo( "Hello world " + VAR2CHAR( nIndex ) )
         SEPARATOR
         MENUITEM "&load Media" ACTION MP_LoadFile( oVLCX, nIndex )
         SEPARATOR
         MENUITEM "play &Next" ACTION MP_PlayNext( oVLCX, nIndex )
      ENDMENU

      ACTIVATE POPUP oPopup WINDOW oDlg AT nRow, nCol
   ENDIF

RETURN nil


now i want to call

Code: Select all | Expand

PROCEDURE MP_PlayNext( oVLCX, nIndex )
   IF hb_isObject( oVLCX )
      //  SysRefresh()
      MsgInfo( "ready to play Next" )
      oVLCX:Stop()
      oVLCX:Play_Next()
   ELSE
      MsgInfo( "Error Object", "MP_PlayNext()" )
   ENDIF
RETURN

---

when use SysRefresh() it still "hang" but when using MsgInfo() it work :o

so my Question : what can i use instead of MsgInfo() and "why" is it working while other "hang" :?:
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: SysRefresh() ( DO Events) / MsgInfo() and ActiveX()

Post by Antonio Linares »

Dear Jimmy,

Please try with SysWait( 1 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: SysRefresh() ( DO Events) / MsgInfo() and ActiveX()

Post by Jimmy »

hi Antonio,
Antonio Linares wrote:Please try with SysWait( 1 )

YES, that Trick work.
Thx
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: SysRefresh() ( DO Events) / MsgInfo() and ActiveX()

Post by Antonio Linares »

Dear Jimmy,

You may try with other values less than 1, in example 0.5
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: SysRefresh() ( DO Events) / MsgInfo() and ActiveX()

Post by Jimmy »

hi Antonio,

using Syswait() now also CLASS Code work as expect :D
greeting,
Jimmy
Post Reply