473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to open same type of file in a single instance of the application using C#

Hi,


In .Net 2005 Win forms, My application will generate a file with the extention of .rrt. When ever i m opening this file from any location it has to associate with my applicaiton and open in it. Currently it is opening as said above. But when i am trying to open another file it is one more instance of my application. How to avoid opening one more instance of my application and open the selected file in the existing instance of the application? Thanks in advance.

With
bloreboy
Aug 6 '07 #1
3 1876
shweta123
692 Expert 512MB
Hi,

What do you mean by opening a file in same Instance of Application?
Is your file is another application and you are opening it Process.Run?
Also can you please specify some of your code details?
Aug 6 '07 #2
Hi,

My application is generating a file with the extention of .rrt. I used file association. It means, when i am trying to open the .rrt file from windows explorer it will open that file into my application. My problem is, when i am trying to open one more file its not open with the existing instance of the application. It is opening one more instance of the application and opening the file into that. It should have to open in the same instance of my application.

In MainForm.cs,

public MainForm(string[] args)
{
if (args.Length > 0)
{
-- - - ---
- - ----
}
}


And in Program.cs,

static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new MainForm(args));
}


thanks,
bloreboy

Hi,

What do you mean by opening a file in same Instance of Application?
Is your file is another application and you are opening it Process.Run?
Also can you please specify some of your code details?
Aug 7 '07 #3
shweta123
692 Expert 512MB
Hi,

See if these links help you

Link1
Link2
Aug 7 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sarah | last post by:
Hello. I am using Microsoft.Office.Interop.Excel in a C# .NET project. I want to open an Excel application with a specific file name. I am currently opening it with this code: ...
1
by: Konstantin | last post by:
Can someone help me figure out a way to open a form only once in an MDI app. I have an MDI app that contains several forms. I use each form depending on the type of document that the user needs...
55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
115
by: TheAd | last post by:
At this moment I use MsAccess and i can build about every databound application i want. Who knows about a serious open source alternative? Because Windows will be a client platform for some time, i...
8
by: sudha | last post by:
Hi, To open a word doc from c#, i use the following code : Word.ApplicationClass WordApp = new Word.ApplicationClass (); // give any file name of your choice. object fileName =...
2
by: Rudy Ray Moore | last post by:
Anybody notice that while debugging, excel (and some other apps) have a "hard time" opening? Anybody know why this is? "hard time" - takes 20 seconds to open, low CPU usage. I'm using VC++...
2
by: Sin | last post by:
Hello everyone, I'm totally stumped at how little info I can find in MSDN or on the web concerning this. It's almost as if only microsoft personel hold the key to these secrets or something!!! ...
6
by: Seok Bee | last post by:
Dear Experts, In my web application, I'm having a button to view an attachment. After I retrieve the record from database (Ms. Access), I have a button to view the attachment (if there is any)....
5
by: Ruben | last post by:
Hello, I am using the "Application.FollowHyperlink strFilePath, , True" line of code from within access forms to launch any file type I want (e.g., xls, doc, pdf, etc.). The files open up okay,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...
0
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...

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.