News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Open file in an existing instance of Code Blocks

Started by apostrophe, June 04, 2007, 06:25:54 PM

Previous topic - Next topic

apostrophe

I’d like for Code Blocks to open an associated file in an existing instance, instead of in a new instance. Is this possible?

For example:

I have a project open in Code Blocks, and when I double-click a file in Explorer, I’d like it to open in the same instance that the project is in. Currently, it opens in a new instance of Code Blocks.

John

dmoore

well in theory "settings->environment->allow only one running" instance should take care of that.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

apostrophe

Quotewell in theory "settings->environment->allow only one running" instance should take care of that.

Tried that. That gives me an error - "Another program instance is already running, aborting" when I try to open another file.

dmoore

actually, I don't have this problem even with that option unchecked. sorry to lead you down the wrong path...

I assume you are running windows?

two things to check:
1. do you have more than one version of cb installed? if yes, only one can be set as the default file association for a given file type. thus double clicking may be spawning the unopened instance if the unopened instance has the associations. (if you double click on a second file, it should not spawn a third instance of cb, but open in the second)
2. you may need to set the file associations: "settings->environment->check and set file associations..."

try that and report back...
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

apostrophe

It's working correctly now. I'm running Windows 98. I uninstalled Code Blocks, deleted the Program Files\Code Blocks folder, then reinstalled and all is well now.

Thanks for the help.


Electron

I have the reverse problem. Double clicking a project file always opens in the existing instance. I am able to start a new instance only by launching the codeblocks executable. Any ideas?
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.