Numerous problems when application is started using "Open with"
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Numerous problems when application is started using "Open with"

  1. #1
    Join Date
    Apr 1999
    Posts
    123

    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.
    Last edited by Bob H; July 16th, 2013 at 03:48 PM.

  2. #2
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,000

    Re: 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:
    Opened with what? How does opening a file created by a program affect the behaviour of the program?
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #3
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,523

    Re: Numerous problems when application is started using "Open with"

    Quote Originally Posted by Bob H View Post
    ...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!
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinViewer - an integrated GDI objects viewer for Visual C++ Debugger, and more...

  4. #4
    Join Date
    Apr 1999
    Posts
    123

    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.

  5. #5
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,523

    Re: Numerous problems when application is started using "Open with"

    Quote Originally Posted by Bob H View Post
    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.
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinViewer - an integrated GDI objects viewer for Visual C++ Debugger, and more...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center