Page 2 of 2 FirstFirst 12
Results 41 to 54 of 54

Thread: VB6 which runs from Windows session log in "this app seems to not respond"

  1. #41

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    Quote Originally Posted by DEXWERX View Post
    I'm sure you can refactor this nicely, but here's a draft.

    Code:
    Option Explicit
    
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private m_Busy As Boolean
    
    Private Sub Form_Load()
        Show
        
        ' Set properties needed by MCI to open.
        MMControl1.Wait = False ' Async
        MMControl1.DeviceType = "WaveAudio"
        MMControl1.FileName = "C:\WINDOWS\Media\Windows XP Startup.wav"
    
        ' Open the MCI WaveAudio device.
        m_Busy = True
        MMControl1.Notify = True
        MMControl1.Command = "Open"
        Dim Start As Single: Start = Timer
        Do
            DoEvents
            Sleep 1
            If Timer - Start > 0.2 Then Exit Do ' timeout
        Loop While m_Busy
        If Not m_Busy Then MMControl1.Command = "Play"
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        MMControl1.Command = "Close"
    End Sub
    
    Private Sub MMControl1_Done(NotifyCode As Integer)
        m_Busy = False
    End Sub
    interesting, I never digged deep in that control.

  2. #42
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    Found a thread that mentions these properties of the App object that might help:

    Code:
    App.OleRequestPendingTimeout
    App.OleServerBusyTimeout 
    App.OLEServerBusyRaiseError
    Looks like App.OLEServerBusyRaiseError = True might be a good idea? You will get an error raised and if you trap it you can take any action you like?

    Thread here: http://forums.codeguru.com/showthrea...witch-to-retry
    Last edited by jpbro; Mar 14th, 2017 at 06:48 PM. Reason: Changed advice from FALSE to TRUE

  3. #43

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    guys, I thinks I am claiming about the wrong little window alert... this app already has disable ghosting..

    and the alert is this:

    Is it the same as the da mn not responding app?. right?.

    This is when the computer just start up and is too busy to respond quickly...

    Sometimes it does half way typing the user/pass, so no any SOUND play.

  4. #44
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    Did you try App.OLEServerBusyRaiseError = True and then trap that error? Or perhaps try setting App.OleServerBusyTimeout to a higher number? I think those settings apply to that particular dialog.

    PS: The Not Responding I was referring to is in the Window title, not that separate dialog. I think that dialog only appears when using an out of process OLE server call...maybe this is WMI?

  5. #45

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    Quote Originally Posted by jpbro View Post
    Did you try App.OLEServerBusyRaiseError = True and then trap that error? Or perhaps try setting App.OleServerBusyTimeout to a higher number? I think those settings apply to that particular dialog.

    PS: The Not Responding I was referring to is in the Window title, not that separate dialog. I think that dialog only appears when using an out of process OLE server call...maybe this is WMI?

    okkkkkk seems to be in the right track....

    I will test.

  6. #46

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    Quote Originally Posted by jpbro View Post
    Did you try App.OLEServerBusyRaiseError = True and then trap that error? Or perhaps try setting App.OleServerBusyTimeout to a higher number? I think those settings apply to that particular dialog.

    PS: The Not Responding I was referring to is in the Window title, not that separate dialog. I think that dialog only appears when using an out of process OLE server call...maybe this is WMI?
    yeah I also was confused I though both things were about the same feature. So, I searched the wrong thing, and my frustration was increasing over time.

    I will preffer it to trigger an error, so with ON ERROR GOTO I can skip the task. But I don't know what are the usual response times, I would preffer to set time to a quarter of second but not risking to do the feature impossible to run.

    Anyone has experience setting those OLE timmings?

    App.OleRequestPendingTimeout
    App.OleServerBusyTimeout
    App.OLEServerBusyRaiseError

  7. #47

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    well App.OleServerBusyTimeout default is 10 seconds, App.OleRequestPendingTimeout default is 5 seconds.

    so, it can work for WMI requests in 4 and 2 seconds respectivelly?

  8. #48
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    Quote Originally Posted by flyguille View Post
    yeah I also was confused I though both things were about the same feature. So, I searched the wrong thing, and my frustration was increasing over time.

    I will preffer it to trigger an error, so with ON ERROR GOTO I can skip the task. But I don't know what are the usual response times, I would preffer to set time to a quarter of second but not risking to do the feature impossible to run.

    Anyone has experience setting those OLE timmings?

    App.OleRequestPendingTimeout
    App.OleServerBusyTimeout
    App.OLEServerBusyRaiseError
    The defaults are 5 and 10 seconds:

    https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
    https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx

  9. #49

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    ok if I understand correctly now, App.OleRequestPendingTimeout is the time when the WMI query is already waiting a reply, and the if the user hit a key or click with mouse, it will pass by default 5 seconds before appearing that little warning?

    and serverbusytimeout is the time that will pass before detecting it is busy?



    I am trying to do this..


    if busy, don't wait, just trigger an error and escape the feature.

    So I don't want the app to freeze like 5 seconds or so, I want it as much give 2 seconds, but I unkown if in normal load the WMI procedure will complete within just one second, or needs 4 second or so. So I imagine it is a test and error go.



    EDIT: now I think ServerBusyTimeout is for when the APP is the provider of the OLE service, so VB will trigger a request event until that time? and the other is for client side right?.
    Last edited by flyguille; Mar 17th, 2017 at 07:13 AM.

  10. #50
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    All depends how important are the tasks that the p

    That'rogram is doing at the time the message appears, if these tasks are neccesary and you need them even if they take time, then these values should be highter in order to avoid the message and still perform the tasks.

    That's as I understand it.
    Last edited by Eduardo-; Mar 17th, 2017 at 02:27 PM.

  11. #51

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    Quote Originally Posted by flyguille View Post

    and the alert is this:

    .
    I already wrote this:

    App.OleRequestPendingTimeout = 2000
    App.OleServerBusyRaiseError = True

    in the form load

    then I use ON ERROR GOTO to trap any error and escape the task.

    And that message box continues appearing. What I am doing wrong?



    PD: this is an example of how I am using WMIqueries

    Code:
    Public Sub SendUSBDevicesList()
    Dim objWMIService As Object
    Dim colDevices
    Dim objDevice As Object
    
    On Error GoTo Escape
    
    Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
    Set colDevices = objWMIService.ExecQuery("Select * From Win32_USBControllerDevice")
    
    Call Send_Message(254, "", "Clear")
    
    For Each objDevice In colDevices
        Call Send_Message(254, objDevice.Dependent)
    Next objDevice
    
    Call Send_Message(254, "", "Done")
    
    Exit Sub
    
    
    
    Escape:
    Resume Escape2
    Escape2:
    
    End Sub
    Last edited by flyguille; Apr 8th, 2017 at 05:17 PM.

  12. #52

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    investigating, if I understand now, https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx , https://support.microsoft.com/en-us/...ole-automation , , OLEServerBusyRaiseError is for the server side of the OLE?

    Anyway, I don't understand why OLEServerBusyRaiseError had no effect no error raised.

    app.OLERequestPendingTimeout = 0 or OLERequestPendingTimeout = 60000 zero, or some looong way will do the trick, but it will prevent the app to be responsive to user inputsm as the task is never aborted.
    Last edited by flyguille; Apr 9th, 2017 at 11:48 PM.

  13. #53
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    The DisableProcessWindowsGhosting used in my Interpreter, but for wait situations you need something like MsgWaitForMultipleObjects,
    This is a part of SleepWaitEdit2 sub in module 7. Windows check if an application missing messages and then decide to inform the user. By using a loop to get the messages
    You can found the code here https://github.com/M2000Interpreter/...ster/sleep.bas
    Do
    lBusy = MsgWaitForMultipleObjects(1, hTimer, False, _
    INFINITE, QS_ALLINPUT&)
    DoEvents
    Loop Until lBusy = WAIT_OBJECT_0

  14. #54

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    894

    Re: VB6 which runs from Windows session log in "this app seems to not respond"

    Quote Originally Posted by georgekar View Post
    The DisableProcessWindowsGhosting used in my Interpreter, but for wait situations you need something like MsgWaitForMultipleObjects,
    This is a part of SleepWaitEdit2 sub in module 7. Windows check if an application missing messages and then decide to inform the user. By using a loop to get the messages
    You can found the code here https://github.com/M2000Interpreter/...ster/sleep.bas
    Do
    lBusy = MsgWaitForMultipleObjects(1, hTimer, False, _
    INFINITE, QS_ALLINPUT&)
    DoEvents
    Loop Until lBusy = WAIT_OBJECT_0

    you mean to run it before to try the wmi query?.

    anyway,

    App.OleServerBusyRaiseError = True

    hasn't any effect, BUSY is never converted in an error. It always shows the message box, blocking the vb.

    so,

    I setup the pending, to 25 seconds.

    App.OleRequestPendingTimeout = 25000
    app.oleserverbusytimeout =60000

    It fixed it.

    The weird thing, is if it was freeze unresponsived as to trigger the message box, now it don't seems to lost response to the user. I experimented 1 o 2 seconds of lag as much when attempting to write in text box, just as fast as the PC is completing the booting, but no longer than that.

    And before in the same situation, it was a guaranteee to show that message box, ¿So, why before was all that extra time unresponsive?, trashing the VB6 app to its unusability. And the default is 5 seconds!. So I stil don't understand from where all that EXTRA unresponsiveness as to trigger the message box
    Last edited by flyguille; Apr 11th, 2017 at 01:01 PM.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width