Shoutbox

[Solved] WriteString - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Solved] WriteString (/showthread.php?tid=66007)

[Solved] WriteString by go2hell on 09-09-2006 at 04:05 PM

Hello,

I'm trying to change the custom dateTime format according to a variable, from a DateTimeControl.

code:
var SysFormatStruct = Interop.Allocate(20);
SysFormatStruct.WriteString(0,  _dateFormat, true); //_dateFormat == "MM-dd-yyyy"    -> Line 452

when i run it i get
quote:
Error: Invalid procedure call or argument.
Line: 452. Code: -2146828283.



Any ideas what i'm doing wrong here?

Thanks.
RE: [Help] WriteString by Eljay on 09-09-2006 at 04:11 PM

quote:
Originally posted by Scripting Documentation
Offset
[number] Index in the memory block where the string will be written. It must be between 0 and Size - (String.length * 2) - 2 if WriteUnicode is true and between 0 and Size - String.length - 1 if WriteUnicode is false.


seeing as unicode is set to true, your databloc needs to be at least 22 bytes to fit a 10 character string ((10 * 2)+2).
RE: [Help] WriteString by go2hell on 09-09-2006 at 04:33 PM

Thank you, that solved it.