Menu

#65 EAccessViolation on exit when 2 realterms are started from JS script

V3.0.0.27
open
nobody
None
Not Fixed
5
2015-10-08
2015-10-08
No

I get an EAccessViolation when a JS which opens two realterms. Works when two realterms are opened manually, or only one realterm is opened from the JS.

EAccessViolation in module realterm.exe at 0024A460.
Access violation at address 0064A460 in module realterm.exe. Read of address 0.

I run Windows 7/x64. Script is as follows:

// Simple demo of a JScript controlling Realterm
// This is run from the windows commandline by the windows scripting host.
// It is the modern version of a batch file, and a better way to do it.
// Javascript and VBScript can also be embedded into html pages

// There are lots of tools. A nice simple editor/ide is Adersoft JsEdit (free demo)
// You should download:
// - Latest version of the Microsoft scripting host
// - Microsoft script debugger
// - Windows Scripting help file
// - an editor eg Adersoft JsEdit
//

// FRLM: Starta med "Öppna med/Microsoft Windows Based Script Host"
// Det går även att scripta från .BAT-filer, men det verkar bökigt och säkerligen
// långsammare, plus bat-filernas begränsningar

var RT_port_1 = 10
var RT_port_2 = 11
var LF = 10
var CR = 13

var RT = new ActiveXObject("realterm.realtermintf");
RT.caption="Windows Scripting Host Demo 1";
RT.HalfDuplex=1;
RT.baud=57600;
RT.FlowControl=2; //2=RTS/CTS
RT.Port=RT_port_1;
RT.PortOpen=1;
RT.LinefeedIsNewline=1;
RT.SelectTabSheet("I2C");
// Om Visible är 0, så visas inte realterm-fönstret. 
RT.Visible=1;

var RT2 = new ActiveXObject("realterm.realtermintf");
RT2.caption="Windows Scripting Host Demo 2";
RT2.HalfDuplex=1;
RT2.baud=57600;
RT2.FlowControl=2; //2=RTS/CTS
RT2.Port=RT_port_2;
RT2.PortOpen=1;
RT2.LinefeedIsNewline=1;
RT2.SelectTabSheet("I2C");

RT.PutString("G1"); 
RT.NewlineTerminal();
WScript.Sleep(500);

RT.PutString("Skickad rad 1 från RT 1"); 
// NewlineTerminal flyttar utgående data till en ny rad i /sändande/ terminal,
// men skickar varken CR eller LF till mottagaren.
RT.NewlineTerminal(); 
RT.PutString("Skickad rad 2 från RT 1"); 
RT.PutChar(LF);
RT.PutString("Skickad rad 3 från RT 1"); 
RT.PutChar(CR);
RT.PutString("Skickad rad 4 från RT 1"); 
RT.PutChar(CR);
RT.PutChar(LF);
RT.PutString("Skickad rad 5 från RT 1"); 
WScript.Sleep(500);
// Med ovanstående inställningar av LineFeedIsNewLine och
// default-inställningarna i övrigt, så flyttas inkommande text alltid till ny
// rad, oavsett om LF, CR eller CR/LF inkommer.

RT2.PutString("G1"); 
RT2.NewlineTerminal();
WScript.Sleep(500);

RT2.PutString("Skickad rad 1 från RT 2"); 
RT2.NewlineTerminal();
WScript.Sleep(500);
RT2.PutString("Skickad rad 2 från RT 2"); 
RT2.PutChar(10); //LF
RT2.NewlineTerminal();
WScript.Sleep(500);

// Realterm script ger  ett felmeddelande om man inte kör RT.Close().
WScript.Echo("Realterm will close when you click OK");
RT.Close();
RT2.Close();

Discussion


Log in to post a comment.