Can you try to write and read the same data to a binary file (I don't
know which COM object to use to test this), and tell me if you
encounter the same issue.
Thanks.
Franck.
> --
> Group jslibs - http://groups.google.com/group/jslibs -
> jsl...@googlegroups.com
> Unsubscribe: jslibs-un...@googlegroups.com
Thanks for looking into this.
Writing to a file works as expected, outputting 0x00-0xFF correctly. Writing
exactly the same data to the OCX produces problems.
My results are attached as a zip file (to prevent email messing up the
formatting). I've included the code I used, dumps from a hex editor looking
at the file output, and the output of a serial port monitor looking at the
serial port output.
I have also made a zip archive containing all the resources necessary to run
this test code, including the OCX and serial port monitor, so that it's easy
to duplicate these results. It's here:
ftp://www.philrhodes.com/public_html/client/soubok/serial-ocx-text.zip (8MB,
includes OCX source code in VB6)
One minor note: if I do this with jscript.exe I have no choice but to do
this:
serial.output = String.fromCharCode(n);
This produces exactly the same problems as jslibs currently has with this:
serial.output = buf.read(1);
We know jscript's string handling is not binary-safe. However jslibs' string
handling is supposed to be binary-safe, which may shed some light on what's
going wrong.
Thanks!
P