Loading ...
Sorry, an error occurred while loading the content.

Re: SetWMHandler trouble. i think.

Expand Messages
  • b6sw
    The problem could be where the SCAN statements are placed. Any SCAN statement is an opportunity for event handling to occur, including callbacks. From your
    Message 1 of 2 , Apr 1, 2012
    • 0 Attachment
      The problem could be where the SCAN statements are placed. Any SCAN statement is an opportunity for event handling to occur, including callbacks. From your description, the program seems to be pingponging from one SCAN loop to another, eventually getting back to the original loop after the window it acts upon had already been closed.

      My advice is when using WMLiberty is never rely on code you place after SCAN to execute in a timely manner. It could execute in a different order to what you expect, and it could possibly happen that it never gets executed at all. For that reason, in all of my examples I only call the Sleep API and GOTO the SCAN statement in an infinite loop.

      Brent

      http://www.b6sw.com/dlls


      --- In libertybasic@yahoogroups.com, "tony.tampa" <markkg1@...> wrote:
      >
      > Ok im having a little trouble... And i think i need to turn off whatever iv turned on in the following code..
      >
      > Callback lpfn1, OnNotifyM( ULong, ULong, ULong, ULong ), Long
      > Call SetWMHandler hWnd(#FSmainM), _WM_NOTIFY, lpfn1, -1
      >
      > While dummy$ <> "EOD"
      >
      > Scan
      > CallDLL #kernel32, "Sleep", 60 As Long, r As Void
      > <your code here>
      >
      > wend
      > _
      >
      > ___________________________________________
      > later in the code we open a popup and this :-
      > _____________________________________________________________________
      >
      >
      > Callback lpfn2, OnNotifyX( ULong, ULong, ULong, ULong ), Long
      > Call SetWMHandler hWnd(#XXmainX), _WM_NOTIFY, lpfn2, -1
      >
      > While dummy$ <> "EOD"
      >
      > Scan
      > CallDLL #kernel32, "Sleep", 60 As Long, r As Void
      > <your code here>
      >
      > wend
      >
      > the thing is iv got about 5 popup windows and 1 main window, they have multi column listbox's. on every window.. but the program at strange unpradictable times jump from 1 routine to the other. ie a routine drawing an image on the scren suddenly jumps to a routine filling a textbox on a window that is closed. i cant think of any other part of the program that could effect program flow in this way. Unfortunatly i cant debug it. as callbacks wont work in debug mode.
      >
      > Ohh and yes iv got diferent pointers for each diferent callback.
      >
      > i feel i need to reset the setWHhandler before i close the window , to stop false window messages snd possible triggers to routines that are not in use...
      >
      > id post the file.. but i dont expect anyone to dig through 99888 lines of code ...
      >
      > thanks in advance ... Mark.
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.