The only function that you can call is GetTPIErrorDescription_VB
. All the others use C++ classes that you cannot access. So I suggest that you do the following:
- Remove all the other functions from the header file.
- Remove the
#include
and theusing
lines. - Remove the
#ifdef
and replaceTRACKERERRORSDLL_VB
with__stdcall
. - Either include
windows.h
or add some#define
statements for the Win32 types. - Possibly deal with the
bool
type depending on whether or not MATLAB knows how to deal with it. If MATLAB won't recognise it, replacebool
withint
.
At that point the call to loadlibrary
should work and then you just need to write the code that calls calllib
.
The resulting header file might look like something this:
#define LPSTR char*
__declspec(dllimport) bool __stdcall GetTPIErrorDescription_VB(
int errorNumber,
LPSTR* shortDescription,
LPSTR* longDescription,
LPSTR* solutionDescription,
bool* isAutoRecoverOnGreenState
);
Finally, do note that LPSTR*
is a rather surprising type to encounter. It suggests that the DLL is going to allocate char*
C strings, and then return them to you through the three description parameters. This presents a memory allocation issue. Who is going to deallocate the memory? Does it even need to be deallocated, or is it static? Those issues will need to be resolved by consulting the documentation for the DLL.