March 6, 200521 yr 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 Gerry Howard
March 6, 200521 yr 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
March 6, 200521 yr Author It didn't work. I get the same error message but with 0040195B and 000000A0 this time. Gerry Howard
Create an account or sign in to comment