quote:
Originally posted by MSDN
Return Value
The return value is the length of the text in TCHARs, not including the terminating null character.
(see
http://msdn.microsoft.com/en-us/library/ms632628%28VS.85%29.aspx)
It
should return the visible length (that is, text you can read)...
But you more or less have it working now: Buffer.readSTRING(0); should return the new filename/control ID or whatever you want to rename this way.
Oh and don't forget to collect garbage: always destroy DataBloc objects (if possible), by setting its size to zero:
JScript code:
var Buffer = Interop.Allocate(123);
Buffer.Size = 0;
There are just a few situations in which you cannot destroy memory blocks instantly, but I don't think you'll be in any of those.