Re: command line arguments
That is the default behaviour with PocketPC - only one copy of the application can run.
Should your application already be running?
Re: command line arguments
It is supposed to be a single instance application, associated with certain extensions at all time.(witch is not the case when the application is running)
Think of the behavior of winamp, wmp or other multimedia applications: a file is playing, you browse your computer/pocketpc, and you doubleclick on a media file. The application is instantly brought to the foreground and the file is played(or enqueued, depending on your winamp configuration).
However, to achieve this I need to be able to receive command line arguments at run-time.(the arguments defined in the registry for the given extensions).
Re: command line arguments
If this could help, I need to find a compact framework event that works as the StartupNextInstance event.
Re: command line arguments
I have searched the web to its limits... how the hell do you grab the commandline arguments? What kind of a project are you creating to do this successfully, .Net Compact 1.0 or without the (1.0) tag? A snippet of argument code would be greatly appreciated.
Re: command line arguments
Hi,
just use Sub Main in a module, and do something like...
Code:
Sub Main(ByVal args As String())
For Each arg As String In args
Console.WriteLine(arg)
Next arg
End Sub
Pete
Re: command line arguments
Quote:
Originally Posted by petevick
Hi,
just use Sub Main in a module, and do something like...
Code:
Sub Main(ByVal args As String())
For Each arg As String In args
Console.WriteLine(arg)
Next arg
End Sub
Pete
Thanks so much Pete, finally worked. Can't do it on a form looks like... per this article. http://www.tech-archive.net/Archive/...4-03/0637.html
Thanks again!!!
Re: command line arguments
Ok, i've found a way to do this(accept args at runtime):
I've created a launcher application(console) witch i associate with the extensions that i need and initiated a socket between it and the main app. Upon a double click of a file the launcher is started, receives the path of the file i need to handle. It then tries to send the args via tcp. If the main app isn't working, i just open it with from the launcher with the given args.