필터 지우기
필터 지우기

Error Microsoft C++ exception: mwException at memory location when passing CString to Matlab function

조회 수: 1 (최근 30일)
I passed the path of file to the Matlab function, so it can read it. However, I got crashed again. Here what I did:
in Matlab:
function ImgProc(pathname)
mov=VideoReader(pathname);
nFrames=mov.NumberOfFrames;
for k=1:10
img=read(mov,k);
img=rgb2gray(img);
img = imresize(img, [64, 64]);
imshow(img);
code in C++: sFileName is CString which contains the video file path.
CFileDialog dlgFile(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, _T("Movie Files (*.avi;*.mpg;*.mp4)|*.avi;*.mpg;*.mp4||"), this);
CString sFileName = dlgFile.GetPathName();
bool a=mclInitializeApplication(NULL,0);
bool b= ImgProcInitialize();
mwArray out(sFileName);
ImgProc(out);
ImgProcTerminate();
mclTerminateApplication();
ImgProc function in C++:
ImgProc(const mwArray& pathname);
please help

답변 (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