Author Topic: Browser control fails to recognize response to chat request  (Read 100 times)

0 Members and 1 Guest are viewing this topic.

Offline Douglas Martin

  • Newbie
  • *
  • Posts: 27
  • Gender: Male
    • ProfiTouch
Browser control fails to recognize response to chat request
« on: January 04, 2018, 11:37:15 PM »
I am using the following code to launch a browser control inside a PBWIN application. I pass in the URL https://app.teamsupport.com/Chat/ChatInit.aspx? with some additional parameters to start a CHAT feature. The page renders asking the user to identify themselves and enter a question and then click submit to request a chat.

We see the chat request, and accept. The issue is the page never responds to the fact that the chat has been accepted. eventually it just times out.

I am trying to figure how to debug what is happening and why the browser control, is not responding to the response that we have accepted the chat?. I can paste the URL into chrome and open the developer tools, not sure what I should be looking for, it all works fine. Same for IE11.

At some locations the CHAT feature works fine. Could it have something to do with the ISP blocking some content or the firewall having some ports closed?

Some browser settings blocking Javascript?

If i copy and paste the CHAT URL into IE11 and run it on the machine it works fine?
Code: [Select]
SUB AddBrowser(BYVAL FormName$, Layer As Integer, HTMLfile As String)
   ' // Save the script as a temporary file
   LOCAL bstrTempFileName AS WSTRING
'   bstrTempFileName = AfxSaveTempFile(s, "", "TMP", "html", 1)
   ' // Create the WebBrowser control with the embedded map
   LOCAL nWide, nHigh AS LONG
   ' // Create an instance of the class
   LOCAL pWindow AS IWindow
   pWindow = CLASS "CWindow"

' **********************************************
'    DIALOG GET CLIENT hDlg TO nWide, nHigh
' **********************************************
'   EZGUI version:
' ------------------
   LOCAL FW!, FH!, hDlg AS LONG
   EZ_GetSize FormName$, FW!, FH!, 2 ' get client area in pixels
   nWide = FW!*.5
   nHigh = FH!*.5
   hDlg = EZ_Handle(FormName$,0)
' **********************************************
   EZ_SetLayer Layer

   ' // Create an instance of the event class
   LOCAL pWBEvents AS DWebBrowserEvents2Impl
   pWBEvents = CLASS "CDWebBrowserEvents2"


   If InStr(HTMLfile, "http") Then
     pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, HTMLfile, pWBEvents,  1, 1, nWide, nHigh)
   Else
     pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, RamDrive+HTMLfile, pWBEvents,  1, 1, nWide, nHigh)
   End If     
     ' hCtrl& is handle of a control created using a
     ' non-EZGUI command. ie. a Third party DLL
   EZ_AssignID hDlg, %IDC_WEBBROWSER
   EZ_SetLayer Layer
   EZ_PutOnLayer FormName$, %IDC_WEBBROWSER

   ' // Default message pump (you can replace it with your own)
   'pWindow.DoEvents(iCmdShow)

 END SUB
Doug

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 3129
  • Gender: Male
    • José Roca Software
Re: Browser control fails to recognize response to chat request
« Reply #1 on: January 05, 2018, 12:39:29 AM »
You are connecting events in a SUB using a local variable? The class will be destroyed as soon as the SUB will end.
« Last Edit: January 05, 2018, 09:41:39 PM by José Roca »

Offline Douglas Martin

  • Newbie
  • *
  • Posts: 27
  • Gender: Male
    • ProfiTouch
Re: Browser control fails to recognize response to chat request
« Reply #2 on: January 05, 2018, 09:28:43 PM »
I made pWindow and PWBEvents global vars.  I still get the same result.  Click on submit,  the team support web site recognizes there is a chat request.

I accept the chat but browser control never renders that the chat has been accepted.

The app works on my Windows 10 Pro system and some other systems.

Does not respond to chat acceptance on Windows Embedded Standard Service Pack 1.

I will apply all windows updates to see if that helps.

Any other suggestions?
« Last Edit: January 05, 2018, 10:07:14 PM by Douglas Martin »
Doug