Numerous problems when application is started using "Open with"
When the file that my application saves is opened using right-click/Open with, there are many mysterious problems:
1) AfxMessageBox will not work (based on a small sample) from anywhere in the program. It is ignored.
2) Any files written to temp directory or to the working directory (directory of the opened file) can't be saved because the file path has been mysteriously changed to c:\windows\system32.
3) Any reference to the directory of the opened file is changed to c:\windows\system32.
At first I thought this was a Windows security measure but it seems too crazy.
The program is 13 years old and works fine when the file is opened from inside the program using File > Open or is double-clicked on.
This recent behavior either started when I upgraded from Visual C++ 6.0 to Visual Studio 2008 or started using Windows 7.
Any ideas will be must appreciated.
Re: Numerous problems when application is started using "Open with"
Quote:
When the file that my application saves is opened using right-click/Open with, there are many mysterious problems:
Opened with what? How does opening a file created by a program affect the behaviour of the program?:confused:
Re: Numerous problems when application is started using "Open with"
Quote:
Originally Posted by
Bob H
...the working directory (directory of the opened file) ...
Are you assuming that the directory containing the opened file is your working directory? Then - don't!
Re: Numerous problems when application is started using "Open with"
Setting the working directory fixed the problems. Thanks.
I guess it wasn't necessary when I was compiling with Visual C++ 6.
Re: Numerous problems when application is started using "Open with"
Quote:
Originally Posted by
Bob H
Setting the working directory fixed the problems. Thanks.
I guess it wasn't necessary when I was compiling with Visual C++ 6.
I guess - it has nothing to do with the compiler.