473,513 Members | 2,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Send File to Running Application

I have an app that allows only one instance to run at a time. I have a file
extension associated with this app and would like to pass a running instance
the file name if a user double-clicks the file directly.

Any help would be greatly appreciated.

PJ
Nov 17 '05 #1
2 1500
PJ,

It's a little complicated, but it is possible. First, you would need to
create a remoting server in your application, such that the application that
is the only one running would be the one that is the server. This would
have a method which would take a filename to process.

Then, in the code for the beginning of your app, if you determine that
your app is to be shut down (because another instance is running), you would
hook up to the remoting server that the other app is hosting, and make the
call, passing the filename to process (it should be part of the command line
parameters).

If you are using .NET 2.0, all of this is done for you. There is an
question in the current issue of MSDN magazine in the ".NET Matters"
section. The question regards single-instance applications, and the answer
shows how all of this is done for you. You can find it at (watch for line
wrap):

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"PJ Olson" <pe*****@sux.com> wrote in message
news:eI****************@TK2MSFTNGP10.phx.gbl...
I have an app that allows only one instance to run at a time. I have a file
extension associated with this app and would like to pass a running
instance the file name if a user double-clicks the file directly.

Any help would be greatly appreciated.

PJ

Nov 17 '05 #2
That is very helpful!

Thanks,
PJ

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:u$**************@tk2msftngp13.phx.gbl...
PJ,

It's a little complicated, but it is possible. First, you would need
to create a remoting server in your application, such that the application
that is the only one running would be the one that is the server. This
would have a method which would take a filename to process.

Then, in the code for the beginning of your app, if you determine that
your app is to be shut down (because another instance is running), you
would hook up to the remoting server that the other app is hosting, and
make the call, passing the filename to process (it should be part of the
command line parameters).

If you are using .NET 2.0, all of this is done for you. There is an
question in the current issue of MSDN magazine in the ".NET Matters"
section. The question regards single-instance applications, and the
answer shows how all of this is done for you. You can find it at (watch
for line wrap):

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"PJ Olson" <pe*****@sux.com> wrote in message
news:eI****************@TK2MSFTNGP10.phx.gbl...
I have an app that allows only one instance to run at a time. I have a
file extension associated with this app and would like to pass a running
instance the file name if a user double-clicks the file directly.

Any help would be greatly appreciated.

PJ


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
10185
by: Etienne Charland | last post by:
Hi, there is an application running on a remote desktop (under Citrix ICA, but the same problem applies for RDC or PC Anywhere). Now, I want to send keys to the remote application from a local app....
4
1898
by: Kurien Baker Fenn | last post by:
How to send data from an ASP form to a visual basic form? Please help
4
9410
by: jas | last post by:
I have a basic client/server socket situation setup....where the server accepts a connection and then waits for commands. On the client side, I create a socket, connect to the server...then I...
5
8774
by: Andreas | last post by:
I am working with three computers, my developing computer, a Web Server and a Mail Server (Exchange). I am trying to send a email from the Web Server via the Mail Server to a valid email address...
0
2726
by: SushiSean | last post by:
When executing the xmlhttp.send function to request shipper for available shipments (I send xml as string and receive result xml): XMLHTTP xmlhttp = new XMLHTTP(); xmlhttp.open("POST",...
4
7668
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
I have a web page that at the click of a button must send a bunch (1000+) emails. Each email is sent individually. I have the code working fine, using Mail Message classes and smtp and all that. ...
6
4677
by: ShieldsJared | last post by:
Hello all, I've been working on an application for a while now and have now come to a standstill. I have an application that I intend to have stored on a file server (developed in C#), which...
1
4638
by: krndhi1983 | last post by:
Hi to All, I am using Windows XP running IIS 6.0.I am developing a project using vb.net 1.1 with SQL Server 2000.It is a mobile project.So i am also using Pocket PC 2002 with SQL CE 2.0.When...
1
6536
by: sxwend | last post by:
I am trying to use the following post results (http://www.thescripts.com/forum/thread189759.html) and add another requirement. I need to send the results to just the email addresses that the query...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.