It looks like you are setting the environment variables correctly. In the DOS-box you can check the values of the environment variables by just typing "set" and return, and it will list all of them. Keep in mind that any changes made in a DOS-box only apply to that session of the DOS-box. Any other DOS-box instances will get its environment variables from the system (go to the Advanced tab on the System Properties dialog, and click Environment Variables to set the system variables for a particular user). However, there is a bug in the embeded uir feature that when you call LoadPanel, it tries to create the temporary file in the directory above the one specified in the TMP environment variable. In other words, if your TMP environment variable is "c:\temp
" it will try to create the temporary file in "c:\". This should be fixed in the next version, but for now you can set the TMP environment variable to be a child directory of a directory to which you can write (ie. "c:\temp\dummyFolder").
As for your question about whether it is possible to encode a custom TMP path into the executable... the answer should be yes. We added a new function, _putenv(), to CVI 7.0 that allows you to set environment variables for the current process. So if you called _putenv("TMP=c:\temp"), it sets the TMP environment variable to "c:\temp", and then you could call LoadPanel which should then use "c:\temp" to create the temporary file (notwithstanding the above bug). However, I noticed that the CVI run-time engine caches the value of the TMP environment value at startup, so it doesn't use your new value. We are also looking into fixing this in the next version.
- jared