umm the page you linked to answered it
quote:
lpszFormat
Long pointer to a null-terminated format string...
You pass a pointer to the format string not the string itself.
So you should put the string in a databloc first and pass the pointer to that:
code:
var DTM_SETFORMAT = 0x1032;
var Format = Interop.Allocate(((Language.WndSettings['DateFormat'].length) * 2) + 2);
Format.WriteString(0, Language.WndSettings['DateFormat']);
Wnd.SendControlMessage('DatCDDate', DTM_SETFORMAT, 0, Format.DataPtr);