Sign in to follow this  
dragonflightdesign

Odd problem with SimConnect and panel resizing

Recommended Posts

Well, maybe it isn't such an odd problem - ! :smile:

 

My simconnect gauge works perfectly in both windowed and fullscreen mode, as long as FSX stays in either windowed or fullscreen mode. However, if I resize the FSX window, around thirty seconds later FSX crashes with either a BEX or an appcrash. Commenting out the simconnect gauge stops the crash, so the source is pretty obvious. I think I might have a problem with conflicting calls as during the window resize process PANEL_SERVICE_CONNECT is called before PANEL_SERVICE_DISCONNECT. Can anyone confirm that this might be the source of the problem? If so, is there a way of detecting a window resize call?

 

While writing this, I've considered putting the simconnect gauge in an invisible window which is launched by the main panel as the invisible window would never be resized. Would that help? I don't have time to try it ATM, but I will tomorrow.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Dai,

 

I gave up using PANEL_SERVICE_CONNECT_TO_WINDOW for just this reason.

I usually put my SimConnect initialization and de-initialization routines in module_init and module_deinit.

 

You could also try leaving your de-initialization routine in PANEL_SERVICE_DISCONNECT, making sure you set the value of the handle variable to zero.

You would put your initialization routine in PANEL_SERVICE_PRE_UPDATE, wrapping it in an 'if' statement checking the handle variable against zero.

 

Doug

Share this post


Link to post
Share on other sites

Hello Doug

 

Thanks for confirming that I had at least correctly identified the source of the problem and for providing two possible solutions.

 

-Dai

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this