Automation : Windows Script Host Object Model

AngeloAngelo Member Posts: 180
Hi,Navision Master

I use COM component (Automation) built in Navision : Windows Script Host Object Model but have problem. Some PC can run the COM successfully but some other PC can not. when I check it there is no class WshShell in Windows Script Host Object Model. What the problem? Windows?Service Pack? or I must download it and register it again in Navision?Where website address I can download Navision Com component?

Regards,
Angelo

Comments

  • kinekine Member Posts: 12,562
    There is problem, that there is difference between Win XP and Win 2k etc... if you add the class under Win XP, you will not run it on Win 2k etc... but there is solution... under Win XP there is this class: "'Windows Script Host Object Model'.IWshShell_Class" but is not listed in Navision... Under Win 2k you can see it... workaround is to export the object into text and overwrite the GUID to this (if you do not have Win 2k):
    Automation  "{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 1.0:{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}:'Windows Script Host Object Model'.IWshShell_Class";
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    The problem will be that some PC's uses WinXp, and others Win2000. So you need 2 codeunits: one for each Windows version (and the automation variable points to a different Automation Server).

    You can use the Virtual Table 2000000046 Automation Servers to check what Automation Server is installed on a particular PC. This to determine which Codeunit you need to run (the WinXP version or the Win2000 version). The function fctIsOCXDLLInstalled in the How To: How To install an OCX/DLL on the client's PC when needed (at run-time)? uses this technique.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • kinekine Member Posts: 12,562
    The problem will be that some PC's uses WinXp, and others Win2000. So you need 2 codeunits: one for each Windows version (and the automation variable points to a different Automation Server).

    Yes, it is one solution. My solution are using our customers without problems on WIn2k3 terminal server, on Win XP, etc. It is only about the class, not the library... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.