I don't see where you attach the onComm event. You only create a
function MSComm1_OnComm. Try adding a line:
MSComm1.OnComm = MSComman1_OnComm;
This should attach the function to the event.
This sounds like a really interesting thing. What will you use this
feature for - just very curious!
Benjamin
On Nov 20, 10:19 pm, Roman Bystrianyk <[EMAIL PROTECTED]> wrote:
> I'm trying to get a comm port working from a javascript using an
> ActiveX control. The port is basically working where I can receive
> input from the serial port. BUT - I can't seem to get the OnComm
> event working so can receive the incomming characters async - any
> ideas????
>
> Thanks!
> Roman
>
> var MSComm1 = new ActiveXObject("MSCOMMLib.MSComm");
>
> function onTextClick() {
> view.beginAnimation(doRotation, 0, 360, 500);
>
> MSComm1.CommPort = 1;
>
> if (MSComm1.PortOpen == false)
> {
> MSComm1.Settings = "57600,n,8,1"
> MSComm1.SThreshold = 1;
> MSComm1.RThreshold = 1;
> MSComm1.RTSEnable = 1;
> // MSComm1.InBufferSize = 1;
> MSComm1.InputLen = 1;
> MSComm1.InputMode = MSComm1.comInputModeText;
> MSComm1.PortOpen = true;
> }
>
> msg = "Test Message ";
> // MSComm1.Output = msg;
> msg = MSComm1.Input;
>
> while(msg == "")
> {
> msg = MSComm1.Input;
> }
>
> alert(msg);
>
> // MSComm1.PortOpen = 0;
> // MSComm1.AboutBox();
>
> }
>
> function MSComm1_OnComm(){
>
> alert("onComm");
>
> }
>
> function doRotation() { mylabel.rotation = event.value; }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---