Hello, i have a problem with a dll.
the dll is casmcard.dll, it interface to the ez100 card reader. i'm using a sle4442 smartcard.
The manufactor gave me a simple vb project that call some function from a static class (CasAPI). It wrap the functions using the dllimport.
I am working on a c# program, so i included the project, to use the CasAPI functions. It works, since i have to change the code of a card (SLE4442_Update_Security_Memory()). The point is that it works just in the vb project, and when i call it from my project
it return an error code (SCARD_E_NO_MEMORY that means "Not enough memory available to complete this command").
The vb declaration is
Public Declare Function SLE4442_Update_Security_Memory Lib "casmcard.dll" (ByVal hCard As Integer, ByRef SendBuffer As Byte, ByVal StartAddr As Integer, ByVal SendBufferLength As Integer) As Integer
and i call it as this
response = CasAPI.SLE4442_Update_Security_Memory(mSCardContext, ref code, 1, 3);
code is a 4 byte array
in vb it is called like this:
Result = SLE4442_Update_Security_Memory(CardHandle, Data(0), 1, 3)
There are many other functions that use the reference of the first element of the array to fill it, and i verified that they all works, so it shouldn't caused by the array.
View Complete Post