Liquid UI Forum

Using Your Liquid UI Products => WS aka Web Scripts (Attended RPA for SAP) => Topic started by: Benjamin Dasari on February 22, 2022, 04:20:34 PM

Title: Regarding wsoffice.dll and mscomdlg file open dialog with Windows OS builds
Post by: Benjamin Dasari on February 22, 2022, 04:20:34 PM
Symptoms
When you use Liquid UI to open a dialog window with certain Windows OS[19042.1083, 19042.1165] to select a file, you receive Javascript runtime error related to insufficient memory.
"CommonDialog: The common dialog function failed during initialization. This error often occurs when insufficient memory is available".

This article provides work around to the issue.


Resolution/Work around(a classic select file window shows up):
Change the flags as specified below in getFilesToUpload() function:

function getFilesToUpload(szPrompt)

    if(szPrompt==void 0) szPrompt = 'Select File';
    var dialog = new ActiveXObject('MsComDlg.CommonDialog');
    dialog.Filter='All Files(*.*)|*.*'; 
    dialog.MaxFileSize=32767; 
    dialog.DialogTitle=szPrompt;
    //dialog.Flags=0x200|0x80000|0x800|0x4|0x200000; // FAILS because of 0x80000
    dialog.Flags=0x200|0x800|0x4|0x200000;  // WORKS, but fails if there is no 0x200
    dialog.ShowOpen(); 
    //var ret = dialog.FileTitle;
    var ret = dialog.FileName;
    dialog = void 0;
    return ret;



Findings 1: dialog.Flags=0x200|0x80000|0x800|0x4|0x200000; // FAILS because of 0x80000
Findings 2: dialog.Flags=0x200|0x80000|0x800|0x4|0x200000; // WORKS if high contrast mode of windows is turned on, Search for high contrast using windows search at bottom of the screen, and 'Turn on high contrast'
Findings 3: dialog.Flags=0x200|0x800|0x4|0x200000;  // WORKS
Findings 4: dialog.Flags=0x800|0x4|0x200000;  // Fails if there is no 0x200