Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual C++ Single Instance

Posted on 1997-09-15
2
Medium Priority
?
364 Views
Last Modified: 2012-06-21
I am currently using Visual C++ 4.1 under NT 3.51. I am also using a configuration management package called MKS Source Integrity which utilises file manager's associations to view files, i.e. if I associate .c, .cpp, .h, .rc etc files with VC++ under file manager then all these types of files will be viewed from within VC++. This is all pretty straightforward, however when I try to open a file from MKS or file manager when VC++ is already open, i.e. there ia already an instance of the application running, then another instance of VC++ is created. How can I setup VC++ to limit itself to only one application?
0
Comment
Question by:aj2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
faster earned 20 total points
ID: 1169776
There is no such way.  When you open a file in explorer, the system will check the registry to see which application is registered with the file association.  Normally it is invoked by creating another instance of the application.  Some applications can avoid this by using DDE, for example, if you look at the registry for the shell association of .html, you will see that it has not only the command line info but also the DDE info, so when you open an html file, the system will not invoke a new instance.  For VC, it does not provide such an interface (which you can verify from the registry) and therefore what you want is impossible.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1169777
NO - vc DOES provide such an interface (ie DDE).

In the explorer go to View|Options|File Type

Lookup the file type for, say, .c (which might be called "C Source File")

Highlight it and Click on the "Edit" button (or double click on the file type in the list)

Higlight the "Open" command in the "Actions" list and click on the "Edit" button (or double click on the open acton)

You should see your command line will be the path to your vc ide program with "%1" at the end.

Click on the Use DDE checkbox

The DDE MEssage should be: Open("%1")
The Application should be your ide app name (no path, no extension), for VC5 is it 'msdev', not sure for vc 4 - look at the top edit box for the name
DDE application not running - leave blank
Topic should be: system

Please reject previous reply and let me answer this one if you find it helpful.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question