Have you verified the function was exported properly? The tools dumpbin and depends are handy for doing this. Without having your DLL we can not verify that for you.
The following shows how to structure your code so the functions are exported properly and callable from LabTalk. The code below is simplified for demonstration purposes but will compile fine in Visual C++ and CodeBlocks with GCC.
//---------- main.h
#ifndef __MAIN_H__
#define __MAIN_H__
#include <windows.h>
#ifdef __cplusplus
extern "C"
{
#endif
int __declspec(dllexport) MOMENT(HWND hWnd, LPSTR lpString);
#ifdef __cplusplus
}
#endif
#endif // __MAIN_H__
//---------- main.cpp
#include "main.h"
BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
{
return TRUE;
}
//int FAR PASCAL MOMENT(HWND hWnd,LPSTR lpString);
int __declspec(dllexport) MOMENT(HWND hWnd, LPSTR lpString)
{
return 0;
}