I have a problem with this software, but I don't think that HP is the source of the problem.
This program, HP Director, is a GUI for using their Scanner (HP PSC 1318).
I think that they use a html kind of way do display the program, using java scripts for the menus.
Every time I start the program, I get the following errors:
"A runtime error has occured, Error: Object required" and when debugging, I come to the following code line "var itemStr = tdcMenuRS("dir-menu-"+oDevSettings[i].setting[j].subSetting[k].settingID);"
a second error is: "Error: Object doesn't support this property or method" and the codel ine is: "var lang = tdcStrings.recordset("local-id").value;"
The program doesn't show.
I have the latest java software installed from www.java.com/en/download/, I have reinstalled .NET and MDAC, I have uninstalled and reinstalled the HP software, but nothing seems to help.
Can someone tell me what the source of the problem is?
Thank you!
/Ph
PeejAvery
October 21st, 2005, 02:17 PM
Looks more like VBScript to me. What OS are you running?
If WinXP or 2K:
What Service Pack are you running?
Have you disabled any services?
phil4u2
October 23rd, 2005, 08:10 PM
I use XP2 with SP1 (corporate, not able to update to SP2 due to network admin restrictions).
I have tried to install several times. the first time, normally, the second time with all startup items disabled, third time as a local admin... nothing helps.
The strange thing is: My colleagues have the same XP config and some of them hav no problems, while others have had some problems with the installation.
PeejAvery
October 23rd, 2005, 10:15 PM
I use XP2 with SP1...
XP2? There is only XP Pro or Home.
What services do you have running that are different between the two systems?
phil4u2
October 24th, 2005, 02:25 AM
I use Windows XP, Service Pack 1. Excuse the typo...
the service I have on are the following:
TP-LINK Configuration Service
Application Layer Gateway Service
Asset Management Agent
Application Management
ASP .NET State Service
Anti HotKey Poller
Windows Audio
Background Intelligent Transfer Service
BlackICE
Unicenter Message Queuing Service
CA-Licence Client
CA-Licence Server
Indexing Service
COM+ System Application
Cryptographic Services
DHCP Client
Logical Disk Manager Administrative Service
DM Primer
Logical Disk Manager
DNS Client
Event Log
COM+ Event System
Fast User Switching Compatibility
Fax
FGR Service
Help and Support
InstallDrive Table Manager
IMAPI CD-Burning COM Service
eTrust Antivirus RPC Server
eTrust Antivirus Realtime Server
eTrust Antivirus Job Server
Iomega App Services
iPodService
Infrared Monitor
Server
Workstation
TCP/IP NetBIOS Helper
Event Log Watch
Lotus Notes Single Logon
Messenger
NetMeeting Remote Desktop Sharing
Distributed Transaction Coordinator
Windows Installer
Network DDE
Network DDE DSDM
Net Logon
Network Connections
Network Location Awareness (NLA)
NT LM Security Support Provider
Removable Storage
OracleClientCache80
Plug And Play
PLM Driver HPZ12
Protected Storage
RapApp
Remote Access Auto Connection Manager
Remote Access Connection Manager
Unicenter Remote Control Host
RCManClient
Unicenter TNG RCO
Remote Registry
Remote Procedure Call (RPC) Locator
Remote Procedure Call (RPC)
Security Account Manager
Talk Scheduler
Unicenter Software Delivery
Secondary Logon
System Even Notification
Internet Connection Firewall (ICF) / Internet Connection Sharing (ICS)
Shell Hardware Detection
Print Spooler
Windows Image Aquisition (WIA)
MS Software Shadow Copy Provider
Telephony
Terminal Services
Themes
Windows User Mode Driver Framework
Volume Shadow Copy
Windows Time
Windows Management Instrumentation
Portable Media Serial Number Service
Windows Management Instrumentation Driver Extensions
Automatic Updates
My question is really: When the debugging tells me: "Object Required", what object is it refering to???
I don't know what services My colleages use...
PeejAvery
October 24th, 2005, 07:48 AM
"A runtime error has occured, Error: Object required" and when debugging, I come to the following code line "var itemStr = tdcMenuRS("dir-menu-"+oDevSettings[i].setting[j].subSetting[k].settingID);"
Basically, the tdcMenuRs is failing to load. Why that is happening is our mystery. There may be a bit of software difference between your machine and the one that is working. That is what I am trying to think about. I am not really sure what piece of software would change that.
phil4u2
October 24th, 2005, 07:54 AM
Here's the whole script if it can help:
/*
* ====================== menudata.js ========================
* ====== Javascript include for scan.htm ===========
* ======================================================
*
* Latest Author: James Simon (4/23/03)
*/
// The following lines are critical for menu operation, and must appear only once.
menunum=0;
menus=new Array();
function addmenu()
{
menunum++;
menus[menunum]=menu;
}
// Editable properties START here
timegap=500 // The time delay for menus to remain visible
followspeed=5 // Follow Scrolling speed
followrate=20 // Follow Scrolling Rate
suboffset_top=1; // Sub menu offset Top position
suboffset_left=-1; // Sub menu offset Left position
effect = "fade(duration=0.3);Shadow(color='#777777', Direction=135, Strength=5)" // Special effect string for IE5.5 or above please visit http://www.milonic.co.uk/menu/filters_sample.php for more filters
style1=[ // style1 is an array of properties. You can have as many property arrays as you need. This means that menus can have their own style.
"ffffff", // Mouse Off Font Color
"6ba2c6", // Mouse Off Background Color
"ffffff", // Mouse On Font Color
"b3d5e7", // Mouse On Background Color
"6ba2c6", // Menu Border Color
11, // Font Size
"normal", // Font Style
"bold", // Font Weight
"Verdana", // Font Name
1, // Menu Item Padding
//"../../Skins/hp1/bc/img/menu-arrow.gif", // Sub Menu Image (Leave this blank if not needed)
,
, // 3D Border & Separator bar
, // 3D High Color
, // 3D Low Color
, // Referer Item Font Color (leave this blank to disable)
, // Referer Item Background Color (leave this blank to disable)
, // Top Bar image (Leave this blank to disable)
, // Menu Header Font Color (Leave blank if headers are not needed)
, // Menu Header Background Color (Leave blank if headers are not needed)
]
addmenu(menu=[ // This is the array that contains your menu properties and details
"dirsettings", // Menu Name - This is needed in order for the menu to be called
36, // Menu Top - The Top position of the menu in pixels
, // Menu Left - The Left position of the menu in pixels
, // Menu Width - Menus width in pixels
1, // Menu Border Width
, // Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
style1, // Properties Array - this is set higher up, as above
, // Always Visible - allows the menu item to be visible at all time
, // Alignment - sets the menu elements text alignment, values valid here are: left, right or center
, // Filter - Text variable for setting transitional effects on menu activation - see above for more info
, // Follow Scrolling - Tells the menu item to follow the user down the screen (visible at all times)
1, // Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style
, // Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page
"right", // Position of TOP sub image left:center:right
, // Type of menu use "form" or blank
, // Right To Left - Used in Hebrew for example.
1, // Open the Menus OnClick - leave blank for OnMouseover
, // Menu Header Text (only works on Vertical menus)
, // Reserved for future use
, // Reserved for future use
, // Reserved for future use
,,"",,,0 //,entry title, action string (i.e show-menu=settings),,,0
])
addmenu(menu=[ // This is the array that contains your menu properties and details
"dirhelp", // Menu Name - This is needed in order for the menu to be called
36, // Menu Top - The Top position of the menu in pixels
, // Menu Left - The Left position of the menu in pixels
, // Menu Width - Menus width in pixels
1, // Menu Border Width
, // Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
style1, // Properties Array - this is set higher up, as above
, // Always Visible - allows the menu item to be visible at all time
, // Alignment - sets the menu elements text alignment, values valid here are: left, right or center
, // Filter - Text variable for setting transitional effects on menu activation - see above for more info
, // Follow Scrolling - Tells the menu item to follow the user down the screen (visible at all times)
1, // Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style
, // Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page
"right", // Position of TOP sub image left:center:right
, // Type of menu use "form" or blank
, // Right To Left - Used in Hebrew for example.
1, // Open the Menus OnClick - leave blank for OnMouseover
, // Menu Header Text (only works on Vertical menus)
, // Reserved for future use
, // Reserved for future use
, // Reserved for future use
,,"",,,0 //,entry title, action string (i.e show-menu=settings),,,0
])
var oDevSettings = new Array;
var oDevHelp = new Array;
var actionStrings = new Array;
var actionStringsH = new Array;
var menuStruct = new Array;
var menuStructH = new Array;
// Load settings and help menus values
function loadSettings()
{
getActiveSkin();
//Get file path for settings.xml in User's App Data directory
//Start with 'file:///'
var dsoFilePath = new String("file:\/\/\/");
//Get the path for the file from call to COM code
dsoFilePath += window.external.GetAppDataPath();
//Replace all '\\' occurrences with '/'
dsoFilePath = dsoFilePath.replace(/\\/g,"\/");
//Replace spaces with '%20'
dsoFilePath = dsoFilePath.replace(/\s/g,"%20");
//Add the name of the file
dsoFilePath += "settings.xml"
var xml = new ActiveXObject("msxml");
xml.URL = dsoFilePath;
var devXML = xml.root.children;
if (devXML == null)
return;
for ( var i = 0; i < devXML.length; i++ )
{
oDevSettings[i] = new Object;
oDevSettings[i].devID = devXML.item(i).children.item(0).text;
oDevSettings[i].id = devXML.item(i).children.item(1).text;
oDevSettings[i].setting = new Array;
var settings = devXML.item(i).children.item(2).children
for ( var j = 0; j < settings.length; j++ )
{
oDevSettings[i].setting[j] = new Object;
oDevSettings[i].setting[j].settingID = settings.item(j).children.item(0).text;
if (settings.item(j).children.item(1).tagname == "SUBMENU")
{
oDevSettings[i].setting[j].action = "";
oDevSettings[i].setting[j].subSetting = new Array;
var subSettings = settings.item(j).children.item(1).children;
for (var k = 0; k < subSettings.length; k++)
{
oDevSettings[i].setting[j].subSetting[k] = new Object;
oDevSettings[i].setting[j].subSetting[k].settingID = subSettings.item(k).children.item(0).text;
oDevSettings[i].setting[j].subSetting[k].action = subSettings.item(k).children.item(1).text;
}
}
else
{
oDevSettings[i].setting[j].action = settings.item(j).children.item(1).text
}
}
if (oDevSettings[i].setting[settings.length-1].settingID != "director-change")
{
if (!noSwitch)
{
oDevSettings[i].setting[settings.length] = new Object;
oDevSettings[i].setting[settings.length].settingID = "director-change";
oDevSettings[i].setting[settings.length].action = "javascript:fnChangeAppearance";
}
}
}
BuildSettingsMenu();
//Get file path for help.xml in User's App Data directory
//Start with 'file:///'
var dsoFilePath2 = new String("file:\/\/\/");
//Get the path for the file from call to COM code
dsoFilePath2 += window.external.GetAppDataPath();
//Replace all '\\' occurrences with '/'
dsoFilePath2 = dsoFilePath2.replace(/\\/g,"\/");
//Replace spaces with '%20'
dsoFilePath2 = dsoFilePath2.replace(/\s/g,"%20");
//Add the name of the file
dsoFilePath2 += "help.xml"
var xml2 = new ActiveXObject("msxml");
xml2.URL = dsoFilePath2;
var devXML2 = xml2.root.children;
if (devXML2 == null)
return;
for ( var i = 0; i < devXML2.length; i++ )
{
oDevHelp[i] = new Object;
oDevHelp[i].devID = devXML2.item(i).children.item(0).text;
oDevHelp[i].id = devXML2.item(i).children.item(1).text;
if (devXML2.item(i).children.length > 2)
{
oDevHelp[i].setting = new Array;
var help = devXML2.item(i).children.item(2).children
oDevHelp[i].setting[0] = new Object;
oDevHelp[i].setting[0].settingID = "dir-help";
oDevHelp[i].setting[0].action = "..\\..\\bin\\hpqtax08.exe -l 2000";
for ( var j = 0; j < help.length; j++ )
{
oDevHelp[i].setting[j+1] = new Object;
oDevHelp[i].setting[j+1].settingID = help.item(j).children.item(0).text;
if (help.item(j).children.item(1).tagname == "SUBMENU")
{
oDevHelp[i].setting[j+1].action = "";
oDevHelp[i].setting[j+1].subSetting = new Array;
var subHelp = help.item(j).children.item(1).children;
for (var k = 0; k < subHelp.length; k++)
{
oDevHelp[i].setting[j+1].subSetting[k] = new Object;
oDevHelp[i].setting[j+1].subSetting[k].settingID = subHelp.item(k).children.item(0).text;
oDevHelp[i].setting[j+1].subSetting[k].action = subHelp.item(k).children.item(1).text;
}
}
else
{
oDevHelp[i].setting[j+1].action = help.item(j).children.item(1).text
}
}
oDevHelp[i].setting[help.length+1] = new Object;
oDevHelp[i].setting[help.length+1].settingID = "abt-help";
oDevHelp[i].setting[help.length+1].action = "javascript:fnAboutDirector";
}
else
{
oDevHelp[i].setting = null;
}
}
BuildHelpMenu();
}
// Create the settings menu
function BuildSettingsMenu()
{
var tdcMenuRS = tdcMenuStrings.recordset;
var menuEntriesIdx = 22;
var numMenuEntryFields = 5;
var menuStructIdx = null;
// create any submenus we may need
for (var i = 0; i < oDevSettings.length; i++)
{
for (var j = 0; j < oDevSettings[i].setting.length; j++)
{
if (!oDevSettings[i].setting[j].action)
{
menu = new Array;
menu[0] = "dev" + i + "-" + oDevSettings[i].setting[j].settingID; // menu name
menu[4] = 1; // menu border width
menu[6] = style2; // properties array
menu[6][10] = "../" + skinPath + "/bc/img/menu-arrow.gif";
menu[8] = "left";
menuStructIdx = menuStruct.length;
menuStruct[menuStructIdx] = new Object;
menuStruct[menuStructIdx].name = menu[0];
menuStruct[menuStructIdx].entry = new Array;
var maxMenuWidth = 0;
for (var k = 0; k < oDevSettings[i].setting[j].subSetting.length; k++)
{
if (oDevSettings[i].setting[j].subSetting[k].action)
{
var actionStr;
if (oDevSettings[i].setting[j].subSetting[k].action.substr(0,11) != "javascript:")
{
var actionStringsIdx = actionStrings.length;
actionStrings[actionStringsIdx] = oDevSettings[i].setting[j].subSetting[k].action;
// Create the help menu
function BuildHelpMenu()
{
var tdcMenuRS = tdcMenuStrings.recordset;
var menuEntriesIdx = 22;
var numMenuEntryFields = 5;
var menuStructIdx = null;
// create any submenus we may need
for (var i = 0; i < oDevHelp.length; i++)
{
if (oDevHelp[i].setting != null)
{
for (var j = 0; j < oDevHelp[i].setting.length; j++)
{
if (!oDevHelp[i].setting[j].action)
{
menu = new Array;
menu[0] = "dev" + i + "-" + oDevHelp[i].setting[j].settingID; // menu name
menu[4] = 1; // menu border width
menu[6] = style2; // properties array
menu[6][10] = "../" + skinPath + "/bc/img/menu-arrow.gif";
menu[8] = "left";
menuStructIdx = menuStruct.length;
menuStruct[menuStructIdx] = new Object;
menuStruct[menuStructIdx].name = menu[0];
menuStruct[menuStructIdx].entry = new Array;
var maxMenuWidth = 0;
phil4u2
October 24th, 2005, 07:55 AM
... continued
for (var k = 0; k < oDevHelp[i].setting[j].subSetting.length; k++)
{
if (oDevHelp[i].setting[j].subSetting[k].action)
{
var actionStr;
if (oDevHelp[i].setting[j].subSetting[k].action.substr(0,11) != "javascript:")
{
var actionStringsIdx = actionStringsH.length;
actionStringsH[actionStringsIdx] = oDevHelp[i].setting[j].subSetting[k].action;
// Run the action chosen in the settings menu
function ExecMenuAction(actionStr)
{
window.external.RunApp("menu",
actionStrings[actionStr],
oDevSettings[currentDevice].devID);
}
// Run the action chosen in the help menu
function ExecMenuActionH(actionStr)
{
window.external.RunApp("help",
actionStringsH[actionStr],
oDevHelp[currentDevice].devID);
}
// Run the action chosen in the Support entry in help menu
function ExecMenuActionS(actionStr)
{
window.external.RunApp("supt",
actionStringsH[actionStr],
oDevHelp[currentDevice].devID);
}
// Show the Auto prompt settings dialog
function fnDirectorSettings()
{
// for IE4 use window.open because window.showModalDialog will always show
// the status bar. The text is the status bar cannot be changed.
// See Q191186 is MSDN knowledge base. Note that window.open is not modal.
// Show the About Director dialog
function fnAboutDirector()
{
// for IE4 use window.open because window.showModalDialog will always show
// the status bar. The text is the status bar cannot be changed.
// See Q191186 is MSDN knowledge base. Note that window.open is not modal.
// Run change skin application
function externalChangeApp(exename)
{
return window.external.GetPersistentData(exename);
}
// Call the change skin function
function fnChangeAppearance()
{
var test;
var skinChanger = externalChangeApp("hpqselsk.exe");
// if (skinChanger != "")
// {
// test = eval(unescape(skinChanger));
fnChange();
// }
}
// Change the skin
function fnChange()
{
getActiveSkin();
setActiveStyleSheet(currentSkin);
initializeDevices();
setCurrentDevice();
updateLayout();
}
function getMenuStructIndex(name)
{
var menuIndex = 0;
while (menuIndex < menuStruct.length)
{
if (menuStruct[menuIndex].name == name)
return menuIndex;
else
++menuIndex;
}
return -1;
}
function getMenuStructEntryIndex(menuStructIndex, name)
{
var menuEntryIndex = 0;
while (menuEntryIndex < menuStruct[menuStructIndex].entry.length)
{
if (menuStruct[menuStructIndex].entry[menuEntryIndex].name == name)
return menuEntryIndex;
else
++menuEntryIndex;
}
return -1;
}
function submenuVisible(menuStructIndex)
{
var menuEntryIndex = 0;
while (menuEntryIndex < menuStruct[menuStructIndex].entry.length)
{
if (menuStruct[menuStructIndex].entry[menuEntryIndex].submenu)
{
var menuNumber = getMenuByName(menuStruct[menuStructIndex].entry[menuEntryIndex].submenu);
if (gmstyle("menu"+menuNumber).visibility == "visible")
return getMenuStructIndex(menuStruct[menuStructIndex].entry[menuEntryIndex].submenu);;
}
++menuEntryIndex;
}
return -1;
}
function showkey()
{
var eventKeyCode = event.keyCode;
if (ie4)
return;
var menuName = "dev"+currentDevice+"-settings";
var menuNumber = getMenuByName(menuName);
if (typeof(menuNumber) != "number")
return;
if (gmstyle("menu"+menuNumber).visibility == "visible")
{
if (eventKeyCode == 27)
{
// escape key - close all menus
closeallmenus();
return;
}
var menuIndex = getMenuStructIndex(menuName);
if (menuIndex >= 0)
{
var activeElem = document.activeElement.id;
var menuEntryIndex = getMenuStructEntryIndex(menuIndex, activeElem);
if (menuEntryIndex >= 0)
{
// check for submenu
if (menuStruct[menuIndex].entry[menuEntryIndex].submenu)
{
var submenuNumber = getMenuByName(menuStruct[menuIndex].entry[menuEntryIndex].submenu);
if (gmstyle("menu"+submenuNumber).visibility == "visible")
{
var submenuIndex = getMenuStructIndex(menuStruct[menuIndex].entry[menuEntryIndex].submenu);
if (submenuIndex >= 0)
{
menuIndex = submenuIndex;
menuEntryIndex = 0;
}
}
}
}
else
{
var submenuVisibleIndex = submenuVisible(menuIndex);
if (submenuVisibleIndex >= 0)
{
menuIndex = submenuVisibleIndex;
menuEntryIndex = getMenuStructEntryIndex(menuIndex, activeElem);
}
}
if (menuEntryIndex >= 0)
{
if(eventKeyCode == 38) // up arrow key
{
if ((menuEntryIndex > 0) &&
(menuEntryIndex < menuStruct[menuIndex].entry.length))
{
document.all(menuStruct[menuIndex].entry[menuEntryIndex-1].name).focus();
}
}
else if (eventKeyCode == 39) // right arrow key
{
if (menuStruct[menuIndex].entry[menuEntryIndex].submenu)
{
var mouseOutStr = document.all(menuStruct[menuIndex].entry[menuEntryIndex].name).parentElement.outerHTML;
var popiIndex = mouseOutStr.indexOf("popi");
if (popiIndex >= 0)
{
var popiCmd = mouseOutStr.substr(popiIndex, mouseOutStr.length - popiIndex);
var closingParen = popiCmd.indexOf(')');
if (closingParen >= 0)
{
var popiStr = popiCmd.substr(0, closingParen+1);
ShM=1;
eval(popiStr);
// set focus to first entry in submenu
var submenuStructIndex = getMenuStructIndex(menuStruct[menuIndex].entry[menuEntryIndex].submenu);
document.all(menuStruct[submenuStructIndex].entry[0].name).focus();
}
}
}
}
else if (eventKeyCode == 37) // left arrow key
{
if (menuStruct[menuIndex].name != menuName)
{
var submenuName = menuStruct[menuIndex].name;
var submenuNumber = getMenuByName(submenuName);
gmstyle("menu"+submenuNumber).visibility = 'hidden';
menuIndex = getMenuStructIndex(menuName);
if (menuIndex >= 0)
{
for (var i = 0; i < menuStruct[menuIndex].entry.length && menuStruct[menuIndex].entry[i].submenu != submenuName; i++);
if (i < menuStruct[menuIndex].entry.length)
{
document.all(menuStruct[menuIndex].entry[i].name).focus();
}
}
}
}
else if (eventKeyCode == 40) // down arrow key
{
if ((menuEntryIndex >= 0) &&
(menuEntryIndex < menuStruct[menuIndex].entry.length - 1))
{
document.all(menuStruct[menuIndex].entry[menuEntryIndex+1].name).focus();
}
}
}
else if ((eventKeyCode == 9) ||
(eventKeyCode == 38) ||
(eventKeyCode == 39) ||
(eventKeyCode == 40)) // focus is not on menu
{
document.all(menuStruct[menuIndex].entry[0].name).focus();
}
}
}
if (gmstyle("menu"+menuNumber).visibility == "visible")
{
if (eventKeyCode == 27)
{
// escape key - close all menus
closeallmenus();
return;
}
var menuIndex = getMenuStructIndex(menuName);
if (menuIndex >= 0)
{
var activeElem = document.activeElement.id;
var menuEntryIndex = getMenuStructEntryIndex(menuIndex, activeElem);
if (menuEntryIndex >= 0)
{
// check for submenu
if (menuStruct[menuIndex].entry[menuEntryIndex].submenu)
{
var submenuNumber = getMenuByName(menuStruct[menuIndex].entry[menuEntryIndex].submenu);
if (gmstyle("menu"+submenuNumber).visibility == "visible")
{
var submenuIndex = getMenuStructIndex(menuStruct[menuIndex].entry[menuEntryIndex].submenu);
if (submenuIndex >= 0)
{
menuIndex = submenuIndex;
menuEntryIndex = 0;
}
}
}
}
else
{
var submenuVisibleIndex = submenuVisible(menuIndex);
if (submenuVisibleIndex >= 0)
{
menuIndex = submenuVisibleIndex;
menuEntryIndex = getMenuStructEntryIndex(menuIndex, activeElem);
}
}
if (menuEntryIndex >= 0)
{
if(eventKeyCode == 38) // up arrow key
{
if ((menuEntryIndex > 0) &&
(menuEntryIndex < menuStruct[menuIndex].entry.length))
{
document.all(menuStruct[menuIndex].entry[menuEntryIndex-1].name).focus();
}
}
else if (eventKeyCode == 39) // right arrow key
{
if (menuStruct[menuIndex].entry[menuEntryIndex].submenu)
{
var mouseOutStr = document.all(menuStruct[menuIndex].entry[menuEntryIndex].name).parentElement.outerHTML;
var popiIndex = mouseOutStr.indexOf("popi");
if (popiIndex >= 0)
{
var popiCmd = mouseOutStr.substr(popiIndex, mouseOutStr.length - popiIndex);
var closingParen = popiCmd.indexOf(')');
if (closingParen >= 0)
{
var popiStr = popiCmd.substr(0, closingParen+1);
ShM=1;
eval(popiStr);
// set focus to first entry in submenu
var submenuStructIndex = getMenuStructIndex(menuStruct[menuIndex].entry[menuEntryIndex].submenu);
document.all(menuStruct[submenuStructIndex].entry[0].name).focus();
}
}
}
}
else if (eventKeyCode == 37) // left arrow key
{
if (menuStruct[menuIndex].name != menuName)
{
var submenuName = menuStruct[menuIndex].name;
var submenuNumber = getMenuByName(submenuName);
gmstyle("menu"+submenuNumber).visibility = 'hidden';
menuIndex = getMenuStructIndex(menuName);
if (menuIndex >= 0)
{
for (var i = 0; i < menuStruct[menuIndex].entry.length && menuStruct[menuIndex].entry[i].submenu != submenuName; i++);
if (i < menuStruct[menuIndex].entry.length)
{
document.all(menuStruct[menuIndex].entry[i].name).focus();
}
}
}
}
else if (eventKeyCode == 40) // down arrow key
{
if ((menuEntryIndex >= 0) &&
(menuEntryIndex < menuStruct[menuIndex].entry.length - 1))
{
document.all(menuStruct[menuIndex].entry[menuEntryIndex+1].name).focus();
}
}
}
else if ((eventKeyCode == 9) ||
(eventKeyCode == 38) ||
(eventKeyCode == 39) ||
(eventKeyCode == 40)) // focus is not on menu
{
document.all(menuStruct[menuIndex].entry[0].name).focus();
}
}
}
}
window.document.onkeydown=showkey ;
// Editable properties END here
loadSettings();
dumpmenus() // This must be the last line in this file
phil4u2
October 24th, 2005, 07:56 AM
And the next script that fails is:
/*
* ====================== dir.js ========================
* ====== Javascript include for director.hta ===========
* ======================================================
*
* Latest Author: James Simon (4/23/03)
*/
// Initialize global variables
var debug = new Boolean; // loaded from persist.
var hintsOpen = new Boolean;
var lowerOpen = new Boolean; // loaded from persist.
var hintsWidth = 175;
var totalWidth = 0;
var currentDevice;
var windowHeight = 197; // set for current container app. HTA: 197, HTM/IE: 300
var minWindowWidth = 220; // w/o width of <select> and 'settings'
var widthAdjust = -33; // set for current container app. HTA: 197, HTM/IE: -3
var updateInProgress = new Boolean;
var savedWidth;
var doubleClicked = false;
var currentButton;
var currentSkin;
var skinPath;
var rightMostBtn;
var noSwitch = false;
var jimWidth;
var jimHeight;
// Set active style sheet based on the current skin
function setActiveStyleSheet(title)
{
var i,a, main;
var lang = tdcStrings.recordset("local-id").value;
if ((lang == "cht") || (lang == "chs") || (lang == "jpn") || (lang == "kor"))
title += "a";
for (i=0; (a=document.getElementsByTagName("link")[i]); i++)
{
if (a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("title"))
{
a.disabled = true;
if (a.getAttribute("title") == title)
a.disabled = false;
}
}
}
// Get the current active skin from the xml file
function getActiveSkin()
{
var xml = new ActiveXObject("msxml");
//Get file path for all_skins.xml in User's App Data directory
//Start with 'file:///'
var devFilePath = new String("file:\/\/\/");
//Get the path for the file from call to COM code
devFilePath += window.external.GetAppDataPath();
//Replace all '\\' occurrences with '/'
devFilePath = devFilePath.replace(/\\/g,"\/");
//Replace spaces with '%20'
devFilePath = devFilePath.replace(/\s/g,"%20");
//Add the name of the file
devFilePath += "all_skins.xml"
try
{
xml.URL = devFilePath;
devicesXML = xml.root.children;
currentSkin = devicesXML.item(0).text;
for ( var i=0; i<devicesXML.length; i++ )
{
if (currentSkin == devicesXML.item(i).getAttribute("id"))
{
skinPath = devicesXML.item(i).getAttribute("path")
}
}
}
catch (theException)
{
noSwitch = true;
//Start with 'file:///'
devFilePath = new String("file:\/\/\/");
//Get the path for the file from call to COM code
devFilePath += window.external.GetPersistentData("test");
//Replace all '\\' occurrences with '/'
devFilePath = devFilePath.replace(/\\/g,"\/");
//Replace spaces with '%20'
devFilePath = devFilePath.replace(/\s/g,"%20");
//Add the name of the file
devFilePath += "data\/"
devFilePath += "all_skins.xml"
try
{
xml.URL = devFilePath;
devicesXML = xml.root.children;
currentSkin = devicesXML.item(0).text;
for ( var i=0; i<devicesXML.length; i++ )
{
// Create Skin xml file if it does not exist
function initialize()
{
updateInProgress = true;
getActiveSkin();
setActiveStyleSheet(currentSkin);
debug = false;
initializeDevices();
loadPersist();
setCurrentDevice();
updateLayout();
}
// Set the device to apear in the Director at start up
function setCurrentDevice()
{
// was app started with a context id
var ctxID = window.external.ContextID;
if (ctxID == "")
return;
for (var i = 0; i < oDevice.length; i++)
{
if (oDevice[i].devID == ctxID)
{
currentDevice = i;
break;
}
}
}
// Change the selected device
function changeDevice(device)
{
var saveLength = oDevice[currentDevice].service.length;
loadPersist();
currentDevice=device;
updateLayout();
savePersist();
if ((oDevice[currentDevice].service.length < 8) && saveLength >= 8)
finishLayout();
}
// Expand the right side hints panel
function expandHints()
{
if (updateInProgress)
return;
// Not used - old code
function toggleDebug()
{
// debug = !debug
// updateLayout()
}
// Set up devices data structure
function initializeDevices()
{
// populate oDevice data structure from Devices.xml
oDevice = new Array;
var xml = new ActiveXObject("msxml");
//Get file path for devices.xml in User's App Data directory
//Start with 'file:///'
var devFilePath = new String("file:\/\/\/");
//Get the path for the file from call to COM code
devFilePath += window.external.GetAppDataPath();
//Replace all '\\' occurrences with '/'
devFilePath = devFilePath.replace(/\\/g,"\/");
//Replace spaces with '%20'
devFilePath = devFilePath.replace(/\s/g,"%20");
//Add the name of the file
devFilePath += "devices.xml"
xml.URL = devFilePath;
devicesXML = xml.root.children;
for ( var i=0; i<devicesXML.length; i++ )
{
oDevice[i] = new Object;
oDevice[i].devID = devicesXML.item(i).children.item(0).text;
oDevice[i].id = devicesXML.item(i).children.item(1).text;
oDevice[i].service = new Array;
services = devicesXML.item(i).children.item(2).children
for ( var j=0; j<services.length; j++ )
{
oDevice[i].service[j] = new Object;
oDevice[i].service[j].serviceID = services.item(j).children.item(0).text;
oDevice[i].service[j].action = services.item(j).children.item(1).text
oDevice[i].service[j].status = services.item(j).children.item(2).text
}
if ((devicesXML.item(i).children.length > 3) &&
(devicesXML.item(i).children.item(3).tagname == "STATUS"))
oDevice[i].statusmon = devicesXML.item(i).children.item(3).children.item(0).text;
else
oDevice[i].statusmon = null;
}
// Get data preserved outside Director
function externalGetData(name)
{
return window.external.GetPersistentData(name);
}
// Load the data saved outside of Director
function loadPersist()
{
// replace with Persistence code
hintsOpen = true;
debug = false;
currentDevice = 0;
//var persistHints = window.external.GetPersistentData("hintsOpen");
var persistHints = externalGetData("hintsOpen");
if (persistHints != "")
{
hintsOpen = eval(unescape(persistHints));
}
lowerOpen = true;
var persistLower = externalGetData("lowerOpen");
if (persistLower != "")
{
lowerOpen = eval(unescape(persistLower));
}
//var persistDevice = window.external.GetPersistentData("currentDevice");
var persistDevice = externalGetData("currentDevice");
if (persistDevice != "")
{
var devID = unescape(persistDevice);
for (var j = 0; j < oDevice.length; j++)
{
if (oDevice[j].devID == devID)
{
currentDevice = j;
break;
}
}
}
//window.resizeTo(663,windowHeight)
}
// Save data outside of Director
function externalSaveData(name, value)
{
window.external.SavePersistentData(name, value);
}
// Save hints satus, current device, and second row status
function savePersist()
{
//alert("hello");
externalSaveData("hintsOpen", escape(hintsOpen));
externalSaveData("currentDevice", escape(oDevice[currentDevice].devID));
externalSaveData("lowerOpen", escape(lowerOpen));
//if ((window.screenLeft > 0) && (window.screenTop > 0) && ((window.screenLeft + jimWidth) > 0) && ((window.screenTop + jimHeight) > 0))
//{
// externalSaveData("left", escape(window.screenLeft));
// externalSaveData("top", escape(window.screenTop));
// externalSaveData("right", escape(window.screenLeft + jimWidth));
// externalSaveData("bottom", escape(window.screenTop + jimHeight));
//}
}
// Create the Director layout
function updateLayout()
{
oBtnExpand.innerHTML="";
oBtnExpandOut.innerHTML="";
oBtnHints.innerHTML="";
oBtnHintsOut.innerHTML="";
oMenuBar.innerHTML="";
oMenuHBar.innerHTML="";
oMenuStatusBar.innerHTML="";
oSetArrow.innerHTML="";
oHelpArrow.innerHTML="";
oStatusArrow.innerHTML="";
// Update Select
oSelect.options.length = 0;
for ( var i=0; i< devicesXML.length; i++ )
{
var oOption = document.createElement("OPTION");
oOption.text=oDevice[i].id;
oSelect.options.add(oOption);
}
// Select the current device in the drop down combo box
oSelect.selectedIndex = currentDevice
// Assign the access key to 'Select Device'
var selectText = tdcStrings.recordset("dir-label-select").value;
var selectAccKeyIndex = selectText.toLowerCase().indexOf("<u>");
if (selectAccKeyIndex >= 0)
{
oSelect.accessKey = selectText.substr(selectAccKeyIndex + 3, 1);
}
// Assign the access key to 'Settings' menu item
var settingsText = tdcStrings.recordset("settings-title").value;
var settingsAccKeyIndex = settingsText.toLowerCase().indexOf("<u>");
if (settingsAccKeyIndex >= 0)
{
settingstitle.accessKey = settingsText.substr(settingsAccKeyIndex + 3, 1);
}
// Assign the access key to 'Help' menu item
var helpText = tdcStrings.recordset("help-title").value;
var helpAccKeyIndex = helpText.toLowerCase().indexOf("<u>");
if (helpAccKeyIndex >= 0)
{
helptitle.accessKey = helpText.substr(helpAccKeyIndex + 3, 1);
}
// Assign the access key to 'Status' menu item
var statusText = tdcStrings.recordset("status-title").value;
var statusAccKeyIndex = statusText.toLowerCase().indexOf("<u>");
if (statusAccKeyIndex >= 0)
{
statustitle.accessKey = statusText.substr(statusAccKeyIndex + 3, 1);
}
// Empty old buttons
oAllButtonsT.innerHTML="";
oAllButtonsB.innerHTML="";
if (oDevice[currentDevice].service.length < 8)
{
// add new button - hidden
for ( var j=0; j<oDevice[currentDevice].service.length; j++ )
{
button = oDevice[currentDevice].service[j].serviceID;
var buttonText;
// Hide the drop-down list box and menu if no devices are installed
if ((oDevice.length == 1) && (oDevice[0].devID == "#Hewlett-Packard"))
{
oSelectLabel.style.visibility = "hidden";
oSelect.style.visibility = "hidden";
//oMenuMask.style.visibility = "hidden";
//oMenuHMask.style.visibility = "hidden";
}
updateMenus();
updateInProgress = false;
}
// Display hints for button
function showHint(buttonID)
{
service = buttonID.substring(4);
oHintsTitle.innerHTML="";
oHintsText.innerHTML="";
html="";
// Run external function
function runApp(buttonID)
{
btnID = buttonID.substring(1, buttonID.length - 1);
for (var i = 0; i < oDevice[currentDevice].service.length; i++)
{
if (btnID== oDevice[currentDevice].service[i].serviceID)
{
window.external.RunApp(btnID,
oDevice[currentDevice].service[i].action,
oDevice[currentDevice].devID);
break;
}
}
}
// Present Settings menu based on currentDevice
function processMenu()
{
closeallmenus();
// Status button is clicked
function processStatusBtn()
{
window.external.RunApp("status", oDevice[currentDevice].statusmon,
oDevice[currentDevice].devID);
}
// Not used
function processKeyDown()
{
//if ((window.event.altKey) && (window.event.keyCode >= 48))
//{
// alert("got key down: code="+window.event.keyCode);
//}
// Change the menus
function updateMenus()
{
var maxMenuWidth = 0;
var menuNum = 1;
while(eval("window.menu"+menuNum))
{
maxMenuWidth = 0;
var dirMenu=eval("menu"+menuNum);
var menuName = dirMenu[0];
var menuStructIdx = getMenuStructIndex(dirMenu[0]);
if (menuStructIdx >= 0)
{
for (var i = 0; i < menuStruct[menuStructIdx].entry.length; i++)
{
var entryName = menuStruct[menuStructIdx].entry[i].name;
var elem = eval("document.all('"+entryName+"')");
maxMenuWidth = Math.max(maxMenuWidth, elem.offsetWidth);
}
if (maxMenuWidth > 0)
{
var ancestorElem = eval("document.all('menu"+menuNum+"')");
// add extra pixels for the border and submenu image (arrow bitmap)
maxMenuWidth += (dirMenu[4] * 2) + 8;
//if (maxMenuWidth > document.all('menu1').offsetLeft)
// maxMenuWidth = document.all('menu1').offsetLeft;
ancestorElem.style.width = maxMenuWidth+"px";
for (var j = 0; j < ancestorElem.children.length; j++)
{
var childElem = ancestorElem.children[j];
if ((childElem.children.length > 0) &&
(childElem.children[0].style.width))
childElem.children[0].style.width = maxMenuWidth+"px";
}
}
}
menuNum++;
}
sis();
}
phil4u2
October 24th, 2005, 08:25 AM
here's the packed dir: (see atttached file)
phil4u2
October 24th, 2005, 08:31 AM
One thing I've been thinking of:
At home, I use Mac Os X Tiger. In this Unix OS, I sometimes need to "repair permissions" in order to have the system and programs work correctly.
Is there a similar 'instruction' in the MS Win world? Can it be done? Could this be the cause of the problems?
The reason I think that might be the cause is that when I installed Java, I had to change the permissions in the folder "C:\Program Files\Java\jre1.5.0_05" to make the installation work. (I unchecked "read only" under properties)
Could this particular problem be a similar problem? And if so, how do I repair the permissions in WinXP?
PeejAvery
October 24th, 2005, 12:05 PM
I will take a look at it. In the mean time...can you add code tags so that the scripting isn't so huge on the page?
PeejAvery
October 24th, 2005, 12:19 PM
Well, the example you gave me is full of Java. Does your machine have the latest JavaVM installed and Java 2 Platform?
phil4u2
October 24th, 2005, 10:02 PM
Well, the example you gave me is full of Java. Does your machine have the latest JavaVM installed and Java 2 Platform?
Yes.
I have now tried to uninstall thoroughly, first as myself as user, and then as the local admin. HP has 5 different levels of uninstall: Uninstall.bat, uninstall_L1.bat, uninstall_L2.bat, etc.
I went throught all of them as both users with a restart after each, and then reinstalled the thing as myself to NO AVAIL. It still gives me the same error messages.
PeejAvery
October 24th, 2005, 11:58 PM
HP has 5 different levels of uninstall: Uninstall.bat, uninstall_L1.bat, uninstall_L2.bat, etc.
I am confused. You uninstalled and reinstalled Java 2 Platform and JavaVM? That is what I was refering to.
phil4u2
October 25th, 2005, 01:55 AM
yes, that too... I have installed these 2 programs, as well as 4 different softwares that I was recomended to install before installing the actual HP software: dotnetfx.exe, MDAC_TYP.EXE, msxml.msi and scripten.exe.
I did that, and still the same error message!
PeejAvery
October 25th, 2005, 01:58 AM
That is extremely odd. I guess we are going to have to go fishing. Are all the latest Windows updates installed?
phil4u2
October 25th, 2005, 07:48 PM
I don't know. The network admin decides it!
phil4u2
October 28th, 2005, 09:19 PM
I think I'll give up. I have uninstalled and reinstalled this software about 20 times, (which takes about 1 hour per time), but still have the exact same fault.
I have been in contact with HP's chat support, they gave me links to different 'patches' I should install before reinstalling, NOTHING has helped.
But thank's for trying anyways!!!
Thank God for my iMac G5 at home!!!
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.