Windows XP, ClearCase, Tcl 8.2 == file dialog crash when viewing network level

From: moni (Monica.McKenna_at_siemens.com)
Date: 02/27/04


Date: 27 Feb 2004 11:25:55 -0800

I have an older tcl/tk app that is now running on Windows XP.
If ClearCase is installed, the Windows file dialog,
brought up from a call from tcl to C++, crashes when you attempt
to look at the network level within the file dialog, though
the file dialog is able to first come up OK.

If ClearCase is not on my machine, I don't see this problem.

Suggestions welcome!
Thanks.

char* FILENTGetAFile(const char* startdir, const char* parentname, int filterindex)
{
  requestedFile[0] = '\0';
  _fileDlg.lStructSize = sizeof(_fileDlg);
  _fileDlg.hwndOwner = 0;
  _fileDlg.hInstance = 0;
  _fileDlg.lpstrFilter = _filter;
  _fileDlg.lpstrCustomFilter = 0;
  _fileDlg.nMaxCustFilter = 0;
  _fileDlg.nFilterIndex = filterindex;
  _fileDlg.lpstrFile = requestedFile;
  _fileDlg.lpstrFileTitle = 0;
  _fileDlg.nMaxFile = MAX_FILE_SIZE;
  _fileDlg.nMaxFileTitle = MAX_FILE_SIZE;
  _fileDlg.lpstrInitialDir = startdir;
  _fileDlg.lpstrTitle = 0;
  _fileDlg.Flags = OFN_HIDEREADONLY | OFN_EXPLORER ;
  _fileDlg.nFileOffset = 0;
  _fileDlg.nFileExtension = 0;
  _fileDlg.lpstrDefExt = 0;
  _fileDlg.lCustData = 0;
  _fileDlg.lpfnHook = 0;
  _fileDlg.lpTemplateName = 0;

  Tk_Window parent = Tk_MainWindow(hackInterp);
  if (strlen(parentname)) {
    char* pname = (char*)parentname;
    parent = Tk_NameToWindow(hackInterp, pname, Tk_MainWindow(hackInterp));
    if (parent == NULL) { return ""; }
  }
  
  if (Tk_WindowId(parent) == None) {
    Tk_MakeWindowExist(parent);
  }
  _fileDlg.hwndOwner = Tk_GetHWND(Tk_WindowId(parent));

  int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
  BOOL x = GetOpenFileName(&_fileDlg);
  Tcl_SetServiceMode(oldMode);

...
  }