forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting 'Not Currently In A Callback' during a callback

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Mon Oct 17, 2016 4:57 am    Post subject: Getting 'Not Currently In A Callback' during a callback Reply with quote

I've been getting some of these when the callback processing function is tied to a %tx control.

I've been tagging and tracing these, getting the result from the CLEARWIN_STRING@. Sometimes, I'll get these when depressing the left mouse. Sometimes, when moving the mouse over the control.

I've never had a keypress fail to get recognized as a character being input.

My question is: Can I get the actual message value, rather than just the string?

It will be helpful to find what is initiating a call back whose string value says no call back was in progress.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Oct 17, 2016 6:40 am    Post subject: Reply with quote

I can't see this message within ClearWin+ so I wonder if it is being generated elsewhere.

If you have not already done so, you should consider called permit_another_callback@.

I guess that you are using "CALLBACK_REASON". The "WM_" message number is not available directly but you might be able to get further information by either a) using %mg with a callback return value that allows processing to continue and/or b) a Windows "Spy" application such as the one provided by Microsoft.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Mon Oct 17, 2016 5:07 pm    Post subject: Reply with quote

Apologies: The message is the return value of "?".
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Oct 17, 2016 5:26 pm    Post subject: Reply with quote

Have you tried using permit_another_callback@?
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Mon Oct 17, 2016 6:53 pm    Post subject: Reply with quote

No, I haven't. If I were to use this function, do you think it would help? I do use a TEMPORARY_YIELD@ in this window normally, so I think this underlying requirement may be met.
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Mon Oct 17, 2016 6:56 pm    Post subject: Reply with quote

I do not see any examples of where one would use this, either on initial window creation, or within a loop, or within an existing callback function.

Point me in the right direction and I'll give it a go!
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Mon Oct 17, 2016 6:57 pm    Post subject: Reply with quote

I do not see any examples of where one would use this, either on initial window creation, or within a loop, or within an existing callback function.

Point me in the right direction and I'll give it a go!
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Mon Oct 17, 2016 11:01 pm    Post subject: Reply with quote

As an FYI, I looked at the window handle generating these events, and even though the window does NOT have focus, things like mouse movements will cause the "?" as the CLEARWIN_STRING@ return.

I checked the CLEARWIN_INFO@(CALL_BACK_WINDOW) with the handle of the %tx window (which does NOT have focus, but is visible).
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Oct 18, 2016 7:19 am    Post subject: Reply with quote

As a first step try calling PERMIT_ANOTHER_CALLBACK@() from within your %tx callback function. Let me know if this makes any difference.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Tue Oct 18, 2016 3:33 pm    Post subject: Reply with quote

I ran two scenarios.

First, I placed the call at the end (return) of the callback function. Second, I placed it at the beginning of the callback function before any messages had been retrieved for processing.

The results are the same; I'm still getting "?" responses whether or not the %tx window has focus in response to mouse moves; clicking the left button SOMETIMES generates a "?" along with the proper response (sometimes before, usually after); sometimes, clicking the left mouse button does not generate a MOUSE_LEFT_CLICK, it generates a "?".
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Oct 18, 2016 4:14 pm    Post subject: Reply with quote

I don't think that it matters where you make the call within the callback.

Try leaving it in and also call PERMIT_CALLBACK_IN_WINDOW@(hwnd) where hwnd is the %hw value for the main window.

After that I am stuck.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Tue Oct 18, 2016 4:21 pm    Post subject: Reply with quote

On that last part (PERMIT_CALLBACK_IN_WINDOW), should I restrict its call to only when that window has focus?

I'll try it in any case.

One thing that did happen after my last message; since I have tracing on, I got an attempt to perform I/O while performing I/O fault. I suspect that processing the callback, then getting another callback may have done this. I will attempt to find another tracing solution.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Oct 18, 2016 4:31 pm    Post subject: Reply with quote

Initially I would not restrict the call. The overhead is probably very small.
If it works then you can refine it later.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Tue Oct 18, 2016 5:29 pm    Post subject: Reply with quote

I've tried the calls separately, together, at the start and at the end of the %tx callback, and there is no change.

Stuck, perhaps. Defeated, no.

If I come up with a solution, or a more definite result, I'll let you know.
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Tue Oct 18, 2016 7:27 pm    Post subject: Reply with quote

I removed the FULL_MOUSE_INPUT from the %tx creation and achieved a better (in some ways) result. Here's a list of what happened:

    No more "?"'s when moving the cursor around;
    No more missing left mouse clicks;
    No more "?"'s when pressing the left mouse button, but
    No detection of MOUSE_DOUBLE_CLICK.
    MOUSE_LEFT_RELEASE works for a mouse click, and the %tx control coordinates are correct;

Not getting any MOUSE_MOVE messages negates one utility function, but if the mouse clicks are now reliable, it is a reasonable trade-off.

I'll continue to play with this to see what I can get functional again.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group