LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

open txt file located in another folder

Hello,
I am facing with a strange problem.
In my application, I want to load some UIR and TXT files already created for other programs.
These files are located in a difefrent folder.
In the actual application I load an UIR then I update a ring on it from a text file.
Both UIR and TXT are in the same folder.
 
When I load the UIR :
pnl = LoadPanel (0, "..\\..\\slp100\\operator.uir",...)
everything is OK.
 
 
When I open the TXT
file = OpenFile ("..\\..\\slp100\\operator.txt", VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_ASCII);
file is < 0 (error)
 
Note: if I give the same command with windows "CommandPrompt" everythink work fine.
 
Have someone have already been faced to this?
Any help is appreciated
Thanks
 
baloss
0 Kudos
Message 1 of 4
(3,422 Views)

You can call GetFmtIOError() to get more information about the error that was returned.  Since you are using a relative file path (not an absolute path) is there any chance you made a call to a function that has changed the currently active directory between the call to LoadPanel and the call to OpenFile?

Message Edited by mvr on 03-29-2006 08:58 AM

0 Kudos
Message 2 of 4
(3,421 Views)

Hi,

between the UIR call and the access to TXT file I have only some SetCtrlAttribute on the panel.

I will try to call the GetFmtIOError() to have more information.

Maybe this will require some time because the system is not in my factory but by a subcontractors that informed me about this issue. 

I forget some details:

- I use the call with the relative path in other program (using both CVI6.0 and CVI 8.0) and till now I had no problems

- the file TXT that I want to load is small (2KB) 

When I have more details I will post new message

Thanks

 

0 Kudos
Message 3 of 4
(3,401 Views)

Hello,

I apologize for my support request, but I received different information from subcontarctor.

The first information I received was that UIR was called, but not updated by TXT.

In fact both was not loaded because the PC was not correctly configured.

Now everything is ok, UIR is correctly updated.

Sorry, and thanks to mvr for your answer.

 

baloss

0 Kudos
Message 4 of 4
(3,376 Views)