CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2004
    Location
    Pakistan
    Posts
    260

    Running Application by File (New File extension)

    Hi,
    I have a dialog base application and this is required for my project to use.

    I have used my custom base functions to register a new file extension let say .xyz . To limit the instance i have used Mutext technique ,

    now i would like to know how can i retrieve the associated file name by which my application get triggered or Open? Since two instance cant work , how can i get trigered file information on my dialog....

    Suppose if i click wolvorine.xyz then my application launch and start using this file (i couldnt get this file name and path yet).

    Also suppose if my application is already running and i click on any file e.g. abc.xyz then i need to run that file on my existing running application...

    Thanks in advance

  2. #2
    Join Date
    May 2006
    Location
    beyond the pillars of hercules
    Posts
    295

    Re: Running Application by File (New File extension)

    to load "wolvorine.xyz" or any "*.xyz" on ur application u need to pass the path and exename in your application's command line

  3. #3
    Join Date
    Aug 2004
    Location
    Pakistan
    Posts
    260

    Re: Running Application by File (New File extension)

    yes i can get command line , but how that abc.xyz file know to pass it self as a commandline aurgument to the current exe ??? any idea?

  4. #4
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Running Application by File (New File extension)

    Quote Originally Posted by Wolvorine View Post
    I have a dialog base application and this is required for my project to use.
    REQUIRED? Who decided that this is a requirement?

    You are trying to implement DDE for dialog based application. It is possible; however is it practical? You would have to erite a code supporting DDE conversation and that alone is not what you would want to do. Also, you would have to write a code to handle file opening, saving closing. In addition to all of the above you will realize that you want your application to have a menu, a toolbar and a status bar.

    According to my MEMC postulate you would be much better off starting your application as SDI with CFormView derived class and in your case with doc/view architecture support.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  5. #5
    Join Date
    Aug 2004
    Location
    Pakistan
    Posts
    260

    Re: Running Application by File (New File extension)

    bro i dont need to implement entire DDE , i just need to get the file name and thats it. That file dont need to be save , edit etc. Just on click , need the file name to that application. I know its easy in SDI but my requirement still need a DIALOG..


    Any idea guys????

  6. #6
    Join Date
    Aug 2004
    Location
    Pakistan
    Posts
    260

    Re: Running Application by File (New File extension)

    Anyway it is solved....Thanks everyone

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured