471,326 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,326 software developers and data experts.

Document open on double-click?

I used to know how to do this--I want to double-click on a document created
by my application and have the application and the document open. I have
created the file association in my deployment project, and double-clicking a
document does open my app. But it doesn't open the document.

I recall that the path to the document gets passed to my app as a command
line argument, and My app has to use that path to open the document.. But I
can't remember how to get the path, and I can't find the answer anywhere
online--not even the Google crawler has it.

So, here's my question: How do I get the path to the document that was
clicked, so that I can have my app open the document?

At this point, I'm not trying to do anything fancy, like preventing a second
instance of my app from opening if an instance is already running. All I
want to do is get the path. How do I do that?

Thanks in advance.

--
David Veeneman
Foresight Systems
Jan 20 '06 #1
3 2283
Hello David,

Assuming that you have a Main function that accepts string[] args, can you
check the parameters?

HTH,
r.
I used to know how to do this--I want to double-click on a document
created by my application and have the application and the document
open. I have created the file association in my deployment project,
and double-clicking a document does open my app. But it doesn't open
the document.

I recall that the path to the document gets passed to my app as a
command line argument, and My app has to use that path to open the
document.. But I can't remember how to get the path, and I can't find
the answer anywhere online--not even the Google crawler has it.

So, here's my question: How do I get the path to the document that was
clicked, so that I can have my app open the document?

At this point, I'm not trying to do anything fancy, like preventing a
second instance of my app from opening if an instance is already
running. All I want to do is get the path. How do I do that?

Thanks in advance.

Jan 20 '06 #2
For the benefit of anyone else researching the question, here are a couple
of MSDN articles on point:

http://msdn.microsoft.com/library/de...rgumentspg.asp

http://msdn.microsoft.com/library/de...rstutorial.asp

--
David Veeneman
Foresight Systems
Jan 20 '06 #3
That simple? Thanks.
Jan 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Myrilath | last post: by
6 posts views Thread by Mike Daniel | last post: by
2 posts views Thread by Brett Baisley | last post: by
5 posts views Thread by John Smith | last post: by
3 posts views Thread by Jens Jensen | last post: by
8 posts views Thread by gazza67 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.