Hello, I would like to use CAN libraries on C# project, but when I tried to use the method, I have this error "Can’t find an Entry Point ‘Imx6Can_Init’ in a Pinvoke DLL ‘TdxAllLibrariesDll.dll’.
I have no problem with a C++ project but I would like to use it in C# project. Can you help me ?
Thanks.
thanks it seems better, but I have a problem with one method “Imx6Can_Read”, it is expecting an IntPtr but I have a tCanBuf structure, I tried the method Marshal.StructureToPtr, to have an IntPtr but it throws “argument null exception”. Can you help me for this issue?
EDIT : I tried this way :
can.tCanBuf canBuf = new can.tCanBuf();
IntPtr ptrBuf = Marshal.AllocHGlobal(Marshal.SizeOf(canBuf));
Marshal.StructureToPtr(canBuf, ptrBuf, false);
but the read method returns 0 (while I’m sending data in CAN bus)
Hi, I did manage to send frames, I just have a problem for reception, Can_Read method returns a positive value, but I have an IntPtr that I have to convert into tCanMsg, but the method Marshal.PtrToStructure throws an argument exception. Can you tell me how can I read this value ?
Thanks for you help.