The following crashes LabVEW every time. Similar simple code with the other functions also crashes (e.g. DSSetHandleSize(), DSDisposeHandle(), etc) What am I doing wrong?
I'm using Windows 10, LabVIEW 2018, and Visual Studio 2017.
The C Code:
#include <windows.h>
#include "extcode.h"
#define DLL_EXPORT _declspec (dllexport)
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
DLL_EXPORT uint32_t handle_size(const UHandle h) {
return DSGetHandleSize(h);
}
The LabVIEW code:
The Result