O
oedev
Guest
I've re-produced the issue using a simple ABL form, code below. I instantiate the form using the following code; DEFINE VARIABLE DWatcher AS CLASS DirectoryWatcherTester NO-UNDO. DWatcher = NEW DirectoryWatcherTester( ). DWatcher
oWait( ). Code for the DirectoryWatcherTester; /*------------------------------------------------------------------------ File : DirectoryWatcherTester Purpose : Syntax : Description : Author(s) : Created : Mon Mar 31 15:52:45 BST 2014 Notes : ----------------------------------------------------------------------*/ USING Progress.Lang.*. USING Progress.Windows.Form. USING System.Windows.Forms.*. CLASS DirectoryWatcherTester INHERITS Form: DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO. DEFINE VARIABLE watcher AS System.IO.FileSystemWatcher. CONSTRUCTOR PUBLIC DirectoryWatcherTester ( ): SUPER(). InitializeComponent(). DEFINE VARIABLE notifyEnum AS System.Enum NO-UNDO. MESSAGE "Watcher running" VIEW-AS ALERT-BOX INFORMATION. watcher = NEW System.IO.FileSystemWatcher(). watcher
ath = "c:\temp\watch". watcher:EnableRaisingEvents = TRUE. watcher:Filter = "*.*". notifyEnum = System.IO.NotifyFilters:FileName. notifyEnum = Progress.Util.EnumHelper:Or(notifyEnum, System.IO.NotifyFilters:LastAccess). notifyEnum = Progress.Util.EnumHelper:Or(notifyEnum, System.IO.NotifyFilters:LastWrite). notifyEnum = Progress.Util.EnumHelper:Or(notifyEnum, System.IO.NotifyFilters
irectoryName). notifyEnum = Progress.Util.EnumHelper:Or(notifyEnum, System.IO.NotifyFilters:Attributes). watcher:NotifyFilter = CAST(notifyEnum, System.IO.NotifyFilters). watcher:Created:Subscribe(handler_File). watcher:Changed:Subscribe(handler_File). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END CONSTRUCTOR. /*------------------------------------------------------------------------------ Purpose: Notes: ------------------------------------------------------------------------------*/ METHOD PRIVATE VOID InitializeComponent( ): /* NOTE: The following method is automatically generated. We strongly suggest that the contents of this method only be modified using the Visual Designer to avoid any incompatible modifications. Modifying the contents of this method using a code editor will invalidate any support for this file. */ THIS-OBJECT:SuspendLayout(). /* */ /* DirectoryWatcherTester */ /* */ THIS-OBJECT:ClientSize = NEW System.Drawing.Size(292, 266). THIS-OBJECT:Name = "DirectoryWatcherTester". THIS-OBJECT:Text = "DirectoryWatcherTester". THIS-OBJECT:ResumeLayout(FALSE). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END METHOD. DESTRUCTOR PUBLIC DirectoryWatcherTester ( ): IF VALID-OBJECT(components) THEN DO: CAST(components, System.IDisposable)
ispose(). END. END DESTRUCTOR. METHOD PUBLIC VOID DoWait( ). /* Display and wait for the non-modal form to close */ WAIT-FOR Application:Run( INPUT THIS-OBJECT ). END METHOD. METHOD PRIVATE VOID handler_File(sender AS CLASS System.Object, e AS CLASS System.IO.FileSystemEventArgs): MESSAGE e:FullPath skip e:Name VIEW-AS ALERT-BOX INFORMATION. END METHOD. END CLASS. As soon as a file is dropped into the monitored directory, the form hangs.
Continue reading...




Continue reading...