I have a DLL written in C++ that is used to modify parameters in VISSIM (traffic simulator). Within this DLL, I would like to call MATLAB to send data, perform MATLAB functions, and return data to the DLL. This all occurs outside of an IDE as VISSIM calls the DLL as necessary.
I have (1.) a working DLL that properly modifies VISSIM parameters and (2.) a working .cpp program that opens the MATLAB Engine (these two programs are currently separate - independent of each other).
How can I combine these two programs so that I can call the MATLAB engine from my existing DLL? A simple copy-paste of the .cpp MATLAB engine program into the DLL did not work (I also modified the DLL project properties to include the necessary MATLAB libraries/directories/paths as is done in the .cpp MATLAB engine program properties).
Note: The .cpp MATLAB engine program builds successfully with 'stdafx.h', but when copied to the DLL and then built, I receive fatal error C1083: Cannot open include file: 'stdafx.h' Perhaps this is an issue?