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
Solved

Visual C++ Single Instance

Posted on 1997-09-15
2
354 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
2 Comments
 
LVL 7

Accepted Solution

by:
faster earned 10 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dynamically allocate memory 9 62
Unresolved External Symbols 3 103
Error creating a new C++ project in ,net 20 41
Where are the c++ header files to use in Eclipse? 4 24
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

856 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