Author Topic: Regarding wsoffice.dll and mscomdlg file open dialog with Windows OS builds  (Read 5275 times)

Benjamin Dasari

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 95
    • View Profile
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


« Last Edit: February 22, 2022, 04:35:13 PM by Benjamin Dasari »