On 07/01/2014 01:28 PM, Jonas Maebe wrote:
On 01/07/14 19:06, Paul Breneman wrote:
Thanks Jonas for the help! This now works for me in FPC (MyReturnStr is
PChar):
Status := ps5000aGetUnitInfo( ps5000a_handle, @MyReturnStr[ 0],
StringLen, requiredSize, RInfo);
But in D7 using "@MyReturnStr[ 0]" gives an Access violation exception
in the dll. The address the DLL is trying to write is about the same as
in FPC so I still don't understand why FPC works but D7 doesn't.
How are you allocating space for MyReturnStr?
I'm doing the same thing in FPC and D7:
StringLen := 14;
MyReturnStr := 'test1234567890';
Status := ps5000aGetUnitInfo( ps5000a_handle, @MyReturnStr[ 0],
StringLen, requiredSize, RInfo);
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal