Page 1 of 1

DLL functions returning strings

PostPosted: Fri Jul 20, 2012 1:38 pm
by CashCow
In your documentation of keyword dll (not easy to find by the way) you have specified that a dll imported function can return string as a type.

You failed to mention anywhere how the lifetime of this string is managed.

Your example carefully seems to avoid this issue too.

Fortunately the only DLL function I have had to import so far returns int, although it takes string inputs, that being strcmp() due to your own very weird interpretation of what operator < means between strings, as well as being logically inconsistent regarding ordered sequences. (It is not logically possible for a > b and b > a to both return true.)