Search found 10 matches

by busquim
Wed Sep 10, 2008 6:05 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

Thanks, Tony. In fact, it makes a lot of sense the way you solved the problem. However, I was getting the following error message when running vensim: Run-Time Check Failure #2 - Stack around the variable ' buf' was corrupted. So, I changed the size of ' buf' and it is working now. Again, thank you ...
by busquim
Wed Sep 10, 2008 3:38 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

Yep, here you have part of the code -- not all of them -- and this tests are for two small models so I can validate the code: time=VENGV->time; double myvector[101]; int i; .... // I start reading values from a file appended in the last time step -- it is from this file that comes the vector that, f...
by busquim
Wed Sep 10, 2008 12:24 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

Hey everyone, I am almost done with the tools I need to implement the full version of my models, but I am having trouble with the following: 1. I have a vector in my c++ code, i.e. double myvector[101] (at each model1 time step I have a different myvector), that is suppose to be part of a lookup(Tim...
by busquim
Fri Sep 05, 2008 7:36 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

Bob and Tony,

Thanks a lot. I figured out a similar way Bob described and seems that it is working fine -- although I have a lot of work to finish my model, I am happy with the results I am having for simple cases.

Have a great weekend,

Rodney :)
by busquim
Wed Sep 03, 2008 8:56 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

Hi Bob, sorry about asking you more questions, I know that you are busy, but my models are getting a little bit more complicated, and I can't find a solution for the following problem: I am passing a set of values to a second vensim model (this part is working fine after your help), and I would like...
by busquim
Tue Sep 02, 2008 4:54 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

Bob, I figured out the problem: I missed the #define EXPORTED_PROC __stdcall :)

Thanks a lot. I let you know if everything works fine later on.

Rodney
by busquim
Tue Sep 02, 2008 4:30 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

Just to let you know: I added vendll32.lib using the visual c++ Property Pages (menu linker / Input / Additional Dependencies).
by busquim
Tue Sep 02, 2008 4:15 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

OK, thanks. I see why it will not work the way I was doing -- it seems easier than I thought. However, I am trying to add the vendll32.lib to my project, but I keep having the " unresolved external symbol _vensim_get_data referenced in function _MYSIM" error message. Should I add one more ...
by busquim
Mon Sep 01, 2008 8:43 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

OK, thank you Bob. I've found two examples, vddext.xls and ddeserv.xls, that are working fine, but I don't know how to call vensim from vensim using visual c++ -- I've been playing with few different external function in c++ that are working fine. To have a simple example that works, and learn how t...
by busquim
Fri Aug 29, 2008 5:43 pm
Forum: Vensim
Topic: Calling Vensim from External Function
Replies: 15
Views: 8375

Calling Vensim from External Function

Hi, I am working with a vensim model (i.e. model1) that must call another vensim model (i.e. model2). At each time step, model1 sends a vector to model2, model2 runs from 1 to 100 and then returns a set of values. I need to analyze the returned values to find the best among all of them (kind of brut...