MATLAB: Using calllib for 32 bit native module built in Microsoft Visual C++ 2008.

ccalllibreadlib

Hi,
I am working on a program that will call functions from a dynamic link library that was written in Microsoft Visual C++ 2008 and compiled in Microsoft Visual Studio 2008 as a 32 bit native module. Should I anticipate trouble using loadlib and calllib to access these functions on a 64 bit version of Matlab running on Windows 7? Will the 32 bit vs. 64 bit issue be a problem? Does loadlib and calllib work for C++ dll?
Thanks, Shennan

Best Answer

You can't mix 32-bit s/w and 64-bit s/w. You will not be able to call functions from a 32-bit dll from within a 64-bit application. You either need to recompile the lib as a 64-bit lib, or use a 32-bit version of MATLAB.