#ifndef ASEXPORT
#define DLLIMPORTOREXPORT dllimport
#else
#define DLLIMPORTOREXPORT dllexport
#endif
#ifdef __cplusplus // If used by C++ code,
extern"C" { // we need to export the C interface
#endif
_declspec(DLLIMPORTOREXPORT) string getString() return{"MyString"};
#ifdef __cplusplus // If used by C++ code,
}
#endif
However GetString keeps returning a null pointer. I'm finding this a little hard to debug.
You may well be right, and I'll look into it more- but then it should be finding it without difficulty - because the application actually generates a list of .dll files in the working directory which is where it gets the name of the DLL in LoadLibrary (the code above is a smaller, simplified snippet of a considerably larger application).
I've already rewritten the DLL to look more like this: