home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / mswindo / programm / misc / 1869 < prev    next >
Encoding:
Text File  |  1992-09-15  |  1.5 KB  |  30 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!utcsri!torn!cunews!nrcnet0!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: read-only filename template in COMMDLG GetOpenFilename
  5. Message-ID: <1992Sep16.043133.4676@emr1.emr.ca>
  6. Organization: Energy, Mines, and Resources, Ottawa
  7. References: <1992Sep16.042818.4073@emr1.emr.ca>
  8. Date: Wed, 16 Sep 1992 04:31:33 GMT
  9. Lines: 19
  10.  
  11. How can I make the filename template used in the Common
  12. Dialog function GetOpenFilename non-editable, i.e. READ-ONLY!
  13.  
  14. Suppose an application only recognizes two file types:
  15.      *.XYZ and *.ABC
  16. I supply a table of those 2 templates to GetOpenFilename.  Yes the user
  17. can select either of the templates from the table, but they can also
  18. edit the template, i.e. *.* and choose a file which is NOT *.XYZ or 
  19. or *.ABC.  This seems pretty silly.  Now when I return from 
  20. GetOpenFilename, I have to parse the filename myself and ensure that the
  21. filename extension is either .XYZ or .ABC.  If not, I have to pop up an
  22. error message and call GetOpenFilename AGAIN!  Wouldn't it be a lot 
  23. simpler if the template was READ-ONLY?  GetOpenFilename may as well not 
  24. have user-supplied templates & just do *.* and require user to check it!
  25.  
  26. Plainly put, from the point of view of the application, if it isn't .XYZ 
  27. or *.ABC then it is an unrecognized file! There is no room for creative 
  28. file-naming or user-preferred names!  Imagine the confusion if people 
  29. used names like XXX.ABC instead of XXX.BMP or XXX.ZAP instead of XXX.EXE?
  30.