MFC programming to call Vensim model

Use this forum to post Vensim related questions.
Post Reply
gongyongfu
Junior Member
Posts: 3
Joined: Mon Jun 07, 2021 6:10 am
Vensim version: DSS

MFC programming to call Vensim model

Post by gongyongfu »

Hello everyone:
I want to use MFC programming to call Vensim model, but I have encountered some problems. Please help me with some problems.
1. In the example in the subdirectory DLL / msvc60 under the Vensim installation directory, use visual_ SDUDIO_ Can 2010 software be recompiled?
2. Vensim dssx64 is installed, and the compiled time prompt cannot find vendll32.dll.
3. Can I use visual in the environment of installing Vensim dssx64_ SDUDIO_ Does 2010 program call the actual use case of Vensim model?
gongyongfu
Junior Member
Posts: 3
Joined: Mon Jun 07, 2021 6:10 am
Vensim version: DSS

Re: MFC programming to call Vensim model

Post by gongyongfu »

Hello everyone:
I want to use MFC programming to call Vensim model, but I have encountered some problems. Please help me with some problems.
1. In the example in the subdirectory DLL / msvc60 under the Vensim installation directory, Can I use visual_ SDUDIO_2010 software be recompiled?
2. Vensim dssx64 is installed, and the compiled time prompt cannot find vendll32.dll.
3. Can You use VISIOL_ SDUDIO_2010 in the environment of installing Vensim DSSx64 to program and provide an Example?
thanks much!
Administrator
Super Administrator
Posts: 3876
Joined: Wed Mar 05, 2003 3:10 am

Re: MFC programming to call Vensim model

Post by Administrator »

gongyongfu wrote: Wed Jun 09, 2021 6:19 am 1. In the example in the subdirectory DLL / msvc60 under the Vensim installation directory, Can I use visual_ SDUDIO_2010 software be recompiled?
Yes, you can use Visual Studio 2010.
gongyongfu wrote: Wed Jun 09, 2021 6:19 am 2. Vensim dssx64 is installed, and the compiled time prompt cannot find vendll32.dll.
Change this to vendll64.dll.
gongyongfu wrote: Wed Jun 09, 2021 6:19 am 3. Can You use VISIOL_ SDUDIO_2010 in the environment of installing Vensim DSSx64 to program and provide an Example?
thanks much!
The samples that are provided with Vensim should work with Visual Studio 2010.
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
gongyongfu
Junior Member
Posts: 3
Joined: Mon Jun 07, 2021 6:10 am
Vensim version: DSS

MFC programming to call Vensim model

Post by gongyongfu »

First of all, thank you for your reply, There are still problems:
After running VenMFC.exe directly in the subdirectory of “Users\Public\Vensim\DLL\msvc60”, a message appears: "since VENDLL32.dll cannot be found, the code cannot be executed. Reinstalling the program may fix this problem“

Run VenMFC.dsw in the subdirectory of “Users\Public\Vensim\DLL\msvc60”, and select "yes" in the dialog box to start “Execution (Without Debugging)”. The following information appears:

1>ClCompile:
1> VenMFCDlg.cpp
1> _ WIN32_ WINNT not defined. Defaulting to _ WIN32_ WINNT_ MAXVER (see WinSDKVer.h)
1>c:\users\public\vensim\dll\msvc60\venmfcdlg.cpp(304): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_ s instead. To disable deprecation, use _ CRT_ SECURE_ NO_ WARNINGS. See online help for details.
1> C: program files (x86) Microsoft Visual Studio 10.0, VC, include, studio. H (371): see the statement of "sprintf"
1>c:\users\public\vensim\dll\msvc60\venmfcdlg.cpp(321): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_ s instead. To disable deprecation, use _ CRT_ SECURE_ NO_ WARNINGS. See online help for details.
1> C: program files (x86) Microsoft Visual Studio 10.0, VC, include, studio. H (371): see the statement of "sprintf"
1>c:\users\public\vensim\dll\msvc60\venmfcdlg.cpp(361): error C2660: “vensim_ synthesim_ Vals ": the function takes three arguments
1> VenMFC.cpp
1> _ WIN32_ WINNT not defined. Defaulting to _ WIN32_ WINNT_ MAXVER (see WinSDKVer.h)
1>c:\users\public\vensim\dll\msvc60\venmfc.cpp(52): warning C4996: 'CWinApp::Enable3dControlsStatic': CWinApp::Enable3dControlsStatic is no longer needed. You should remove this call.
1> C: program files (x86) Microsoft Visual Studio 10.0, VC, atlmfc, include, afxwin. H (5347): see the statement of "cwinapp:: enable3dcontrolsstatic"
1> StdAfx.cpp
1> _ WIN32_ WINNT not defined. Defaulting to _ WIN32_ WINNT_ MAXVER (see WinSDKVer.h)
1> Generating code
1>
1> Build failed
1>
1> Time used 00:00:08.23
==========Generated successfully 0, failed 1, latest 0, skip 0==========
In this case, What should I do?
Administrator
Super Administrator
Posts: 3876
Joined: Wed Mar 05, 2003 3:10 am

Re: MFC programming to call Vensim model

Post by Administrator »

Change your code to load "vendll64.dll" instead of "vendll32.dll".

Also ensure that you are building a 64 bit application.
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