Reputation: 15817
When I debug my application (in the VB6 IDE), I have to specify the absolute path (e.g. c:\logfile.log
) to the log file otherwise nothing is written to the log file. However, when the application is live I do not have to specify the absolute path i.e. I can specify logfile.log
. Why is this?
The log file is always in the same directory as the .exe and .dll.
Upvotes: 0
Views: 766
Reputation: 41569
Your file is being written to the current working directory.
When your exe is running this is the folder the exe is sat in, however in Debug mode your exe is actually running from the temporary build location (can't actually remember where this is in VB6).
You can test this simply by doing MsgBox(App.Path)
in your program and seeing what location appears.
You'll probably find that there is a logfile.log
in the location that appears when you run the above command while debugging.
Upvotes: 1