With a second look, I suspect that this might be a compiler issue. Matlab is using lcc compiler, which is C. But in my header file, it contains "extern "C" ", which means it's for C++? Here is what my main header file looks like:
#define DLL_EXPORT
#if defined DLL_EXPORT
#define USB_DLL __declspec(dllexport)
#else
#define USB_DLL __declspec(dllimport)
#endif
#undef UNICODE
#include <windows.h>
#include <malloc.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "stdarg.h"
#include "main.h"
#include "devioctl.h"
#include "ezusbsys.h"
#include "RegisterDefines.h"
extern "C"
{ ...//a bunch of functions here
}
//#############EOF##################
I also created a prototype file, using the demo from the previous answer. I ran it using loadlibrary(dllfilename,@mfilename). With "libisloaded", it returns 1, but the problem is "no functions found".
Is it really the compiler causing this issue? How should I change it?
Thanks!!
Siqi