Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: apostrophe on June 04, 2007, 06:25:54 pm

Title: Open file in an existing instance of Code Blocks
Post by: apostrophe on June 04, 2007, 06:25:54 pm
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
Title: Re: Open file in an existing instance of Code Blocks
Post by: dmoore on June 04, 2007, 08:56:47 pm
well in theory "settings->environment->allow only one running" instance should take care of that.
Title: Re: Open file in an existing instance of Code Blocks
Post by: apostrophe on June 04, 2007, 09:08:04 pm
Quote
well 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.
Title: Re: Open file in an existing instance of Code Blocks
Post by: dmoore on June 04, 2007, 09:48:32 pm
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...
Title: Re: Open file in an existing instance of Code Blocks
Post by: apostrophe on June 05, 2007, 03:10:49 pm
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.

Title: Re: Open file in an existing instance of Code Blocks
Post by: Electron on July 02, 2007, 03:51:28 pm
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?