How create DLL using only C/C++ types?

조회 수: 1 (최근 30일)
Alexander
Alexander 2015년 9월 16일
Library Compiler Application create DLL with MatLab type mwArray (for C++, and mxArray for C):
extern LIB_libcfit_CPP_API void MW_CALL_CONV cfit2(int nargout, mwArray& u, const mwArray& x);
My trading robot (MQL4/5 language of www.metaquates.net) can't use functions from DLL with such types. So I create function for robot (working in Metatrader 4):
__declspec(dllexport) int __cdecl Cfit(double* px, int N)
{
mwArray mwx(N, 1, mxDOUBLE_CLASS);
mwx.SetData(px, N);
mwArray u;
cfit2(1, u, mwx);
double result[1];
u.GetData(result, 1);
return static_cast<int>(result[0]);
}
Could you show a simple example (steps) how to create (using MatLab and/or Visual Studio) DLL for Metatrader?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Deploy to C++ Applications Using mwArray API (C++03)에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by