Jump to content
Sign in to follow this  
Guest bartels

Resizing C gauge causing FS to Crash

Recommended Posts

Guest AndrewW

I have written a C gauge, that receives variables and read/writes to FSUIPC. When I resize the window that the transparent gauge is on, Flight Sim crashes. I have checked that the bitmap and mouse areas are set-up correctly and cannot find any errors in the code. Might someone know what area could be causing this issue? Appreciate any help or suggestions. Andy

Share this post


Link to post
Share on other sites
Guest bartels

Where do you initialize the FSUIPC stuff? In the gauges_cb? Then try PANEL_SEVICE_CONNECT_TO_WINDOW and PANEL_SERVICE_DISCONNECT;Arne Bartels

Share this post


Link to post
Share on other sites
Guest AndrewW

Arne, Thank you for your response. I am using both of those. The FSUIPC code is under the gauge_cb. And includes the following sections (snippets taken from the gauge): ************void FSAPI FDUMP ( PGAUGEHDR pgauge, SINT32 service_id, UINT32 extra_data ){ PUINT32 pfdump = (PUINT32)dump_l.var_ptr;************ case PANEL_SERVICE_PRE_INITIALIZE: // "initialize_routine() initialize_var_by_name (&dump_l, "dump_l"); break;************ case PANEL_SERVICE_CONNECT_TO_WINDOW: FSUIPC_Open2(SIM_ANY, &dwResult, &FsuipcMem, 1024); FSUIPC_Write(0x8001, 32,

Share this post


Link to post
Share on other sites
Guest bartels

Hmm, the FSUIPC Code does look good, I haven't checked though. It does look almost identical to mine and I didn't have any problems with it yet OK I use first SIM_FS2K2 and if that doesn't work,(dwResult==FSUIPC_ERR_WRONGFS) I retry with SIM_FS2K4, but I don't think that this is the point.. But the "register_var_by_name" stuff can lead to problems if not done properly.Arne Bartels

Share this post


Link to post
Share on other sites
Guest AndrewW

Thanks Arne, I've had a few people look at it, though none seem to know what may be causing the issue. I know it's not the bitmap or mouse areas, as these look correct also..///////////////////////////////////////////////////////////////MAKE_STATIC( Fdump_background, BMP_BACK, NULL, NULL, IMAGE_USE_TRANSPARENCY | IMAGE_USE_ERASE, 0, 0,0)PELEMENT_HEADER CFDUMP_list = &Fdump_background.header;////////////////////////////////////////////////////////////////////////MOUSE_BEGIN( FDUMP_mouse_rect, 0, 0, 0 )MOUSE_END/////////////////////////////////////////////////////////MODULE_VAR dump_l;MODULE_VAR dump_r;Might it be something in the H file? Andy

Share this post


Link to post
Share on other sites
Guest bartels

I can't see it from the snippet. You might try a structured approach, first comment out all FSUIPC code, retry, if it still crashes it is NOT a FSUIPC issue. Then comment out all _by_name stuff, retry,.. etc.Arne Bartels

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...