06-12-2015 03:23 AM
i created some C wrappers ,i have used one of basic( MTL.dll) call call and lib file in another application dll call.The application dll was written in cvi 2010 to interface with labview.Some of call working properly,when i executing the below call i getting "FATAL RUN-TIME ERROR : Unknown Source position,thread id 0x00001F98 ,the program has caused a 'General Protection' fault at 0x06C3081F".When i used debug mode the below call after return function encounter this problem.I have read the documentation in ni forum but i am unable to over come this error.Please guide me how to procude to next.
shambhu
06-26-2015 03:24 AM - edited 06-26-2015 03:40 AM
Hi Shambhu,
Based on the symptom you are describing, I suspect that you have a calling convention mismatch for your exported function.
I see that you don't specify an explicit calling convention, which means that the code will be generated with the default one specified in your project.
For example, a CVI project by default has __cdecl (Options >> Build Options) but it is possible that your other application uses __stdcall convention, therefore you have a mismatch.
If you are using the CVI-built DLL from LabVIEW through the Call Library Function node, please ensure the Function prototype and Calling convention are the same as your C code.
Regards,
Alpar