TrueGUI Developers Notebook

 

ChangingWorkingDirectory

Page history last edited by Mike Talbutt 2 yrs ago

ERRORS Changing FormsDirectory

Sometimes changing a FormsDirectory will fail, such as when it is a mapped network drive and not currently available. You will not get the error unless you ask. Here is what one customer does:

Command: <== { TrueGui.FormsDirectory=Q:executable }
Command: <== { TrueGui.LoadAssembly(ERMisc2) }
Command: <== { TrueGui.ErrorCount? }
Data: 0

 

****DRAFT as part of an update to using FTP/mwt

How to check and change the working directory of the TrueGUI session.

For the following to work, the beginning of your form must include:

 

using System.IO;

Command: <== { NextEvent? }
Debug command: <== { Directory.SetCurrentDirectory("C:") }
Command: <== { NextEvent? }
Debug command: <== { Directory.GetCurrentDirectory()? }
Data: C:
***Queued 5 bytes to be sent to the server***
***Transmitted 5 bytes to the server***
***Received 130 bytes from server***
! Got TypeCode 2="C:", length: 4
! Not the BigButton - control name is MyForm.FtpGetFile
Command: <== { NextEvent? }

 

NOTE: "TrueGui.CurrentDirectory" is about the Program's Directory, not the Working Directory:

Command: <== { NextEvent? }
Debug command: <== { CurrentDirectory? }
Data: C:Program FilesAlpha MicrosystemsTrueGUI
***Queued 45 bytes to be sent to the server***
***Transmitted 45 bytes to the server***
***Received 140 bytes from server***
! Got TypeCode 2="C:Program FilesAlpha MicrosystemsTrueGUI", length: 44
! Not the BigButton - control name is MyForm.FtpGetFile
Command: <== { NextEvent? }

Comments (0)

You don't have permission to comment on this page.