Jump to content
Sign in to follow this  
mgh

BORLAND C++ BUILDER4

Recommended Posts

In order better to understand C gauges, I'm trying to put together a free-standing application. I'm not sure if this is possible but, by trial and error, I've got it to complile and run. My includes are:#include "MainUnit.h"#include #include "GAUGES.h"#include "SDK.h"#include "sdk.c"I've also added panels.dll to the project.However, it fails on the second of the following lines of code:MODULE_VAR MyVar = {RECIP_ENGINE1_ENGINE_RPM};initialize_var(&MyVar);lookup_var(&MyVar);The error message relates to access violation at address 0040195B: read of address 00000098. Experience suggests that this is usually the result of an uninitialsed variable.The values of MyVar before calling initialize() are:id: 390 /*RECIP_ENGINE1_ENGINE_RPM */var_ptr: NULLvar_type: 0 /* VAR_TYPE_NONE */var_value: {n:0, b:0, e:0, f:0, p:NULL, d:0, o:0}var_old: {n:0, b:0, e:0, f:0, p:NULL, d:0, o:0}I presumed that the purpose of intialise is to complete MyVar as far as it can, in particular var_type. I wouldn't expect to see any values until after lookup_var.I'd welcome any advice.Thanks in advance

Share this post


Link to post
Share on other sites

Take take the 'initialize_var(&MyVar);' statement right out, you don't need it. Just declare the variable and you can then read it with the 'lookup_var' statement.Doug

Share this post


Link to post
Share on other sites

It didn't work. I get the same error message but with 0040195B and 000000A0 this time.

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...