Clear Filters
Clear Filters

Accessing a dll from outside of Matlab, using visual studio and c++

3 views (last 30 days)
I am trying to write an application that will allow me to access a dll from outside of Matlab.
Previously in Matlab I have tried:
>>loadlibrary('Wintab32', 'WINTAB'), but have had no luck accessing the dll file (may have been due to issues with 16bit and 32 bits in files).
A helpful suggestion was to use the DLL outside of Matlab by writing an application in c++ that will call on the DLL.
I am trying to use Microsoft Visual Studio (as a beginner) and learn C++, but it's hard to know where to begin. Can anyone give any helpful suggestions to how I can go about creating the application, or suggest a basic outline of an algorithm that can be implemented to do the above?

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 16 Feb 2012
What you're asking is not really a MATLAB/Simulink-related question (although I understand that you need to do this to be able to load your "wrapper" DLL in MATLAB), so this may not be the right forum to ask this question. At any rate, I did a web search and found this: http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855
In general, you will need to write C++ code that uses the functions LoadLibrary, GetProcAddress and FreeLibrary.

More Answers (0)

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!