Dear Madam or Sir,
I recently purchased a VM110 USB experiment interface board from Velleman.
I would like to control the card via Igor Pro, a scientific data collection and analysis tool.
To control equipment with Igor I have to create an external operational file (.xop) and I am usually doing this using Visual C++ 2010 Express. I am not doing this very often and so my C++ code skills are not that great. I studied your example code and tried to write my little program. The code compiles fine but I get the following linker error:
Creating library C:\Equipment\Software\ALD_program\Debug\ALD_valve_control.lib and object C:\Equipment\Software\ALD_program\Debug\ALD_valve_control.exp
ALD_valve_control.obj : error LNK2019: unresolved external symbol __imp__OpenDevice referenced in function “int __cdecl ALD_valves_Init(struct ALD_valve_control_NoParams *)” (?ALD_valves_Init@@YAHPAUALD_valve_control_NoParams@@@Z)
1>ALD_valve_control.xop : fatal error LNK1120: 1 unresolved externals
I included the K8055D_C.lib in my project but it seems like the functions in the K8055D.DLL can not be accessed in the linking process. If I include the k8055d.lib file instead I get the error message
k8055d.lib : fatal error LNK1136: invalid or corrupt file.
Here is the relevant code in my header file:
#define K8055_App __declspec(dllimport)
#ifdef __cplusplus // C++
extern “C” {
#endif
K8055_App long OpenDevice(long CardAddress);
…
#ifdef __cplusplus
}
#endif
And the relevant piece of code from my source file:
#include “XOPStructureAlignmentTwoByte.h” // All structures passed to Igor are two-byte aligned
struct ALD_valve_control_NoParams {
double result;
};
typedef struct ALD_valve_control_NoParams ALD_valve_control_NoParams;
#include “XOPStructureAlignmentReset.h”
static int
ALD_valves_Init(ALD_valve_control_NoParams* p)
{
int err = 0;
k8055d:OpenDevice(3);
p->result=err;
return 0;
}
I can compile and run the example codes from Velleman but I have problems with linking the dll functions in my code. Taking this into account I assume that I am just not calling the functions correctly but I am not sure where I am doing it wrong.
I would very much appreciate your advice on this.
Thank you,
Mathias