VENSIM_GET_INFO

Use this forum to post Vensim related questions.
Post Reply
pz
Member
Posts: 27
Joined: Thu May 06, 2004 5:33 pm

VENSIM_GET_INFO

Post 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.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post 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
pz
Member
Posts: 27
Joined: Thu May 06, 2004 5:33 pm

VENSIM_GET_INFO

Post 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.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

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