mrvin Posted July 30, 2013 Posted July 30, 2013 Hello, I am trying to call a DLL written in C++ from DAQfactory Pro 5.87 my code is (in C++ routine): __declspec(dllexport) long __cdecl SetVoltage(float fVoltage=-1000, long iChannel=-1) {} and I call it in DAQfactory with: extern (dllpath,"long SetVoltage(float, long)","IRISSetVoltage", "cdecl") result=IRISSetVoltage(2.5,1) I don't get any error message, but the routine in DLL is not executed. I see in dependancy walker (depend.exe) that routine names are mangled, how can I solve that? Thanks!
AzeoTech Posted July 30, 2013 Posted July 30, 2013 To avoid C++ name mangling, wrap your code in an extern "C" block: extern "C" { // your code here } Only the exposed functions need to be in the extern block.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.