Applies To:
  • CitectSCADA 6.XX
  • CitectHMI 6.XX

Summary:
When I use FormOpenFile() in my project with arguments:

FormOpenFile("","[data]:\*.txt","All Files (*.*)");

the dialog box which opens up is not pointing to the data directory (specified in the citect.ini file), rather it points to the "My Documents" folder, or any other arbitrary folder. 
 

Solution:
In this case, the solution is to use the function PathToStr(sPath) in the FormOpenFile() function call. In the case of FormOpenFile() it doesn't understand path operators which may be problematic when it is called.

For example, for the path given above, the correct syntax is:

FormOpenFile("",PathToStr("[data]:\*.txt"),"All Files (*.*)");

Alternatively the path can be hard-coded, for example:

FormOpenFile("","C:\My Stuff\*.txt","All Files (*.*)");
 

Keywords:
FormOpenFile, open file, cicode, dialog box  

Attachments