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

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

Postby Jimmy » Thu Oct 13, 2022 9:17 pm

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 view
     // 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 view
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 view
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
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Antonio Linares » Fri Oct 14, 2022 8:42 pm

Dear Jimmy,

Please try with SysWait( 1 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Jimmy » Fri Oct 14, 2022 9:30 pm

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

YES, that Trick work.
Thx
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

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

Postby Antonio Linares » Fri Oct 14, 2022 9:36 pm

Dear Jimmy,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Jimmy » Sat Oct 15, 2022 9:57 am

hi Antonio,

using Syswait() now also CLASS Code work as expect :D
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 79 guests