You could try to use extern "C" on your unmanaged exported function:
extern "C" RSAVREC_API void REC_stopRecordAvi(unsigned int chnIndex)
{
// implementation
}
You may also want to use __cdecl calling convention:
extern "C" RSAVREC_API __cdecl void REC_stopRecordAvi(unsigned int chnIndex)
{
// implementation
}