using engine_getvarinfo

Posted By: alibaba

using engine_getvarinfo - 07/01/16 10:39

Hi, I'm struggling to get "engine_getvarinfo" to work.
What I want is the name of the variable, but the script gives me the name of the stuct and an empty char.

Code:
#include <acknex.h>
#include <default.c>


typedef struct
{
	var testvar;
}TESTSTRUCT;

TESTSTRUCT tStruct[4];
void test()
{
	char varname[33];
	char structname[33];
	long offset;
	
	long type = engine_getvarinfo(&tStruct[0].testvar,varname,structname,&offset);
	
	printf(varname);
	printf(structname);
}

void main()
{
	test();
}

Posted By: pararealist

Re: using engine_getvarinfo - 07/01/16 13:06

"If the variable or struct is a pointer, engine_getvar returns a pointer to the pointer (see example)."

Would you not have to get the "var" first with engine_getvar() and then pass this to the engine_getvarinfo()?

Seems (to me) that this is what the above line in the manual suggests, but its been a long time since i used any of it.
Posted By: alibaba

Re: using engine_getvarinfo - 07/03/16 17:43

I tried, but it didn't work
© 2024 lite-C Forums