Jump to content
The simFlight Network Forums

Michael Frantzeskakis

Members
  • Posts

    4
  • Joined

  • Last visited

About Michael Frantzeskakis

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://avsim.com/hangar/utils/servinfo/

Profile Information

  • Location
    Greece

Michael Frantzeskakis's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I tried to use FSUIPC from within a gauge as described in the SDK. The gauge I created works fine but most times when I change from an aircraft with this gauge installed to another aircraft (without this gauge) FS2K2 crashes. This seems to be related to FSUIPC because if take out from the gauge code the parts that have to do with FSUIPC the problem does not exist. I am not experienced in C so it is very likely that I may have overlooked/misunderstood something. The part of the gauge code that interfaces FSUIPC follows (sorry I cannot make the identation show correctly). If you have any ideas pls let me know. Thanks, Michael BYTE FsuipcMem; BOOL FsuipcOK = FALSE; BYTE OnState = 1; // 0=off, 1=active, 2=no spd hld, 3=Fsuipc error SHORT FsuipcLev; .................... ///////////////////////////////////////////////////////////////////////////// // Gauge update callback function ///////////////////////////////////////////////////////////////////////////// void FSAPI syncthrottle_update (PGAUGEHDR pgauge, int service_id, UINT32 extra_data) { DWORD dwResult; switch(service_id) { case PANEL_SERVICE_PRE_UPDATE: { ............. if (FsuipcOK) //FSUIPC is already connected { if ( !FSUIPC_Read(0x332E, 2, &FsuipcLev, &dwResult) || !FSUIPC_Process(&dwResult) ) { OnState=3; } else { OnState=1; } } else // FSUIPC is not connected yet: connect now, indication will be updated in next cycle { FsuipcOK=FSUIPC_Open2(SIM_ANY, &dwResult, &FsuipcMem, 64); FsuipcLev=-16193; } ........ break; } case PANEL_SERVICE_PRE_KILL: { FSUIPC_Close(); FsuipcOK = FALSE; } break; } }
  2. I tried to use FSUIPC from within a gauge as described in the SDK. The gauge I created works fine but most times when I change from an aircraft with this gauge installed to another aircraft (without this gauge) FS2K2 crashes. This seems to be related to FSUIPC because if take out from the gauge code the parts that have to do with FSUIPC the problem does not exist. I am not experienced in C so it is very likely that I may have overlooked/misunderstood something. The part of the gauge code that interfaces FSUIPC follows (sorry I cannot make the identation show correctly). If you have any ideas pls let me know. Thanks, Michael BYTE FsuipcMem; BOOL FsuipcOK = FALSE; BYTE OnState = 1; // 0=off, 1=active, 2=no spd hld, 3=Fsuipc error SHORT FsuipcLev; .................... ///////////////////////////////////////////////////////////////////////////// // Gauge update callback function ///////////////////////////////////////////////////////////////////////////// void FSAPI syncthrottle_update (PGAUGEHDR pgauge, int service_id, UINT32 extra_data) { DWORD dwResult; switch(service_id) { case PANEL_SERVICE_PRE_UPDATE: { ............. if (FsuipcOK) //FSUIPC is already connected { if ( !FSUIPC_Read(0x332E, 2, &FsuipcLev, &dwResult) || !FSUIPC_Process(&dwResult) ) { OnState=3; } else { OnState=1; } } else // FSUIPC is not connected yet: connect now, indication will be updated in next cycle { FsuipcOK=FSUIPC_Open2(SIM_ANY, &dwResult, &FsuipcMem, 64); FsuipcLev=-16193; } ........ break; } case PANEL_SERVICE_PRE_KILL: { FSUIPC_Close(); FsuipcOK = FALSE; } break; } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.