DLL

Use this forum to post Vensim related questions.
Post Reply
maxin454
Member
Posts: 35
Joined: Tue Jul 13, 2010 3:17 am

DLL

Post by maxin454 »

Hi. I've developed a java application using Vensim DLL. I packaged the application as a .jar file which includes the vensim model. When you run the .jar file, the vensim model will be extracted to the same directory so that the model can be exercised via my application. The .jar file works fine on my system (which has installed DSS 5.7a). However, an error message "stop from vensim" shows up when only Vensim model reader is installed. Looks like the model cannot be loaded. I was wondering what could the problem be. My goal is to other people run my application with vensim model reader. Thanks for the help.
maxin
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: DLL

Post by Administrator »

Have you packaged the model/jar file up as a VPA from Vensim?

Go back to Vensim, click File->Publish and select the "Other (using Vensim DLL)" as the package type. Make sure you select the JAR file in the "Caller" section and publish. This will create a VPA file, try opening this with Vensim Model Reader (it should then start the JAR file).

Let us know how you get on.

Tony.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
maxin454
Member
Posts: 35
Joined: Tue Jul 13, 2010 3:17 am

Re: DLL

Post by maxin454 »

Thanks, Tony. I forgot to mention that if I package it as .vpa file, the vensim model reader can open the application successfully. Later on I found a way to package the application as a .jar file (I found it more clean compared with .vpa method because only one .jar appears on users' machines instead of a .vpa and a extracted .jar file). Basically, my method is to let the .jar file serves as an .exe file, and when it opens, the vensim model is extracted to a destination where my application knows to look at. It works with no problem when I have DSS on, however, it shows an error message "Stop from Vensim -- open the file D:\my model.vpm using the Vensim Model Reader " when I have reader on. Any potential solutions to this? Many thanks.

maxin
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: DLL

Post by Administrator »

If you want it to run on another machine (for free), the only way is to open the .VPA file with the Vensim Model Reader. It's not as "clean" as you want, but it is free. The alternative is to purchase a Vensim redistribution licence (which would allow you to distribute a custom Vensim DLL).
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Post Reply