Click here to Skip to main content
15,900,108 members

Comments by Areff (Top 12 by date)

Areff 25-Oct-12 14:05pm View    
first of all, tank you for paying attention to this problem and then, what do you mean plug the c++ function into java class ?
Areff 18-Oct-12 3:14am View    
no, but i hope to someone could give a concise explain about the whole algorithm of this C++ function.
Areff 17-Oct-12 8:59am View    
i will be glad to do , but my problem is that i am in Iran and we have not access to international banking system to pay to do this job
Areff 22-Feb-12 5:12am View    
i think it will fill the data area (i have not access to source code of ReadData function)
Areff 22-Feb-12 3:34am View    
ReadData modifies it , and actually ReadData is responsible for reading data from a device and i havenot access to it's code , i just use it and it is working as well as expected in c++ app , it works in P/Invoke but in end of execution and in it's marshaling state error happend.
i changed the code as this code :

[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate int ReadData (ref StringBuilder data);

IntPtr readAddrs = NativeSupport.GetProcAddress(dll, "ReadData");
ReadData read = (MS_Read)Marshal.GetDelegateForFunctionPointer(readAddrs, typeof(ReadData));


StringBuilder d = new StringBuilder(200);
read(ref d);
/"Attempted to read or write protected memory. This is often an //indication that other memory is corrupt."

but error occurred again. using both ref and out ends with same result (the error).