i have this code:
lvItem.pszText = (IntPtr)(lpRemoteBuffer + Marshal.SizeOf(typeof(LV_ITEM)));
it works fine on 4.0.
if i downgrade the project to 3.5 it gives me this error :
Operator '+' cannot be applied to operands of type 'System.IntPtr' and 'int'
any idea how do i fix that to make it work on 3.5
and i dont know why it works in 4.0 ?
thanks in advance
Yup – if you look at the documentation for the Addition property you’ll see that operator was only introduced in .NET 4. You shouldn’t need the cast, by the way.
On .NET 3.5 you could probably use:
Of course you then need to hope you’re not on a 32-bit system with a pointer which goes over
int.MaxValue🙂