programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: browse for file

From: Stefan Schmiedl <s_at_xss.de>
Date: Fri, 5 May 2006 11:00:55 +0200

Dr. Roger Dube (04.05. 19:08):

> We have a strange problem. The following code is used to employ a windows
> file browser to select a file. execute "in-file" and a window pops up, one
> browses to a file, selects it, and the address and count of the filename are
> left on the stack.

works reliably on an old nt4 system running under vmware

> Here's the mystery: in the same SwiftForth session, if we invoke "in-file"
> again, and then move the mouse two or three times WITHOUT CLICKING over some
> files, the window and the swiftforth sessions vanish.

If you're doing this on a new system, probably XP, then you might
want to experiment with folder display settings, as there are strange
things buried down that way.

A few weeks ago, a client's AutoCAD froze upon opening a file in a
directory containing about 100 drawings. We copied the drawing to
an empty folder, it opened by double clicking in the explorer.
We changed the settings in the open dialog from list view to default
and turned previews off, then AutoCAD could open the file in the
original folder, too. The really interesting part is that after this
I restored the open dialog's settings to the original state, and it
still worked.

Since your problem occurs when *moving*, it probably has something
to do with the dynamic things modern Explorers to ... showing info
boxes or displaying previews. Try turning them off on the machine
that's giving you trouble. Also try cleaning out any thumbs.db or
desktop.ini files in the relevant folders.

HTH,
s.
>
>
>
> Here's the code. note we have added debugger statements to trap values and
> steps to a file, but we have not succeeded in determining what is going
> wrong.
>
>
>
> Does anyone see an obvious problem? Note that this behavior does not occur
> on all machines. only some.
>
>
>
> - Roger
>
>
>
>
>
> create infile 256 allot
>
>
>
> OPENFILENAME SUBCLASS FILENAME-DIALOG1
>
>
>
> 256 BUFFER: FILENAME
>
>
>
> 0 OFN_HIDEREADONLY OR
>
> OFN_LONGNAMES OR
>
> CONSTANT DEFAULT-OPEN-FLAGS
>
>
>
> 0 OFN_HIDEREADONLY OR
>
> OFN_NOCHANGEDIR OR
>
> OFN_LONGNAMES OR
>
> OFN_OVERWRITEPROMPT OR
>
> OFN_EXTENSIONDIFFERENT OR
>
> CONSTANT DEFAULT-SAVE-FLAGS
>
>
>
> CREATE ALL-FILES
>
> ,Z" All files (*.*)" ,Z" *.*" 0 ,
>
>
>
> : DEFAULTS ( -- )
>
> StructSize OPENFILENAME SIZEOF ERASE
>
> OPENFILENAME SIZEOF StructSize !
>
> HINST Instance ! HWND Owner ! 1 FilterIndex !
>
> FILENAME zFile ! 254 MaxFile ! FILENAME OFF ;
>
>
>
> DEFER: CUSTOM ( -- title filter flags )
>
> Z" Choose a file to transmit" ALL-FILES DEFAULT-OPEN-FLAGS ;
>
>
>
> DEFER: ACTION ( addr -- bool ) IOR_UNRESOLVED THROW ;
>
>
>
> : CHOOSE ( -- bool )
>
> DEFAULTS CUSTOM Flags ! zFilter ! zTitle !
>
> StructSize ACTION ;
>
>
>
>
>
> END-CLASS
>
>
>
> FILENAME-DIALOG1 SUBCLASS OFN-DIALOG1
>
>
>
> : ACTION ( addr -- bool ) :: GetOpenFileName ;
>
>
>
> END-CLASS
>
>
>
>
>
> OFN-DIALOG1 SUBCLASS EDIT-FILE-DIALOG1
>
>
>
> : CUSTOM ( -- title filter flags )
>
> Z" Select a file:" ALL-FILES ( FORTH-FILES)
>
> DEFAULT-OPEN-FLAGS ;
>
>
>
> END-CLASS
>
>
>
> : in-file ( --addr cnt )
>
> [objects edit-file-dialog1 makes efd objects]
>
> efd choose
>
> if
>
> efd filename zcount infile 256 erase infile zplace
>
> infile zcount
>
> else
>
> 0 0
>
> then ;
>
>
>
> -- Roger
> --------------------------------------------
> Dr. Roger Dube
> President and Chief Science Officer
> Digital Authentication Technologies, Inc.
> 561.392.7404 (office)
> 561.892.2474 (eFax)
> RogerDube_at_datHQ.com
>
> http://www.datHQ.com
>
> 1900 Glades Road Suite 441
> Boca Raton, FL 33431
>
> ----------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and may
> contain confidential and privileged information. Any unauthorized review,
> use, disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all copies
> of the original message. Any views expressed in this message are those of
> the individual sender, except where the sender specifically states them to
> be the views of Digital Authentication Technologies, Inc.
>
>
>
>
>
>
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> For list command help, send subject "help" to sftalk-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product support and bug
> reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>

--
Stefan Schmiedl
+-------------------------------+----------------------------------------+
|Approximity GmbH               | EDV-Beratung Schmiedl                  |
|http://www.approximity.com     | Am Bräuweiher 4, 93499 Zandt, Germany  |
|mailto:stefan_at_approximity.com  | Tel. (09944) 3068-98, Fax -97          |
+-------------------------------+----------------------------------------+
----------------------------------------------------------------------
sftalk_at_forth.com      The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users.  For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Fri May 05 2006 - 02:23:18 PDT

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:21 PST