Page 1 of 1

VENSIM_GET_INFO

Posted: Mon Sep 25, 2006 7:42 am
by pz
Hi,
I'm using c# to build a program with "DLL".
I declare your library function as follows:
***
public static extern int vensim_get_info(int infowanted, StringBuilder buf, int maxbuflen);
***

and I call this function:

***
sb = new StringBuilder(500);
Vensim.vensim_get_info(10, sb, 500);
***
but the function returns only the first name of the currently loaded runs.
How I can get all the data?
Kind regards, Paolo.

Posted: Mon Sep 25, 2006 11:52 am
by bob@vensim.com
This funtion returns a sequence of null terminated strings with a double null to indicate the final string. You can either process that in C# or use the vensim_get_substring function.

Bob Eberlien

VENSIM_GET_INFO

Posted: Thu Sep 28, 2006 10:09 am
by pz
Thanks for the reply.
The function VENSIM_GET_SUBSTRING returns only the first string; the rest is garbage, so this function doesn't fit our problem.
I seem that the only way is working with pointers; isn't it?
kind regards, Paolo.

Posted: Mon Oct 02, 2006 11:35 am
by bob@vensim.com
Hi Paolo,

I have not spent enough time with C# to know much about how to approach this problems but certainly if you can simply use pointers then recast them as needed this would be simplest.