News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

is it possible to use many CB instances ?

Started by Elena, March 15, 2021, 12:10:42 AM

Previous topic - Next topic

Elena

I would like to have several projects each one opened in a separate instance of CB.
To do that I thought that I had to disable both general options
Allow only one running instance...
And
Use an already running instance
Unfortunately even having both options disabled, if I open a .cbp it gets opened inside an already running instance which causes a mess and shouldn't even be allowed imho.
What to do? Thx

oBFusCATed

Open a second instance and then file -> open -> your project
Modify your file associations command to use the --no-ipc option (use --help or /help to check which is the correct spelling for your OS).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Elena

Sorry I forgot to specify that I am on Windows. I am opening my projects by double click on them, not by first launching CB and then opening the project. And when I double click on a project file in Windows and CB is already running, the new project is opened in the already running instance which is what I want to avoid...

oBFusCATed

Quote from: oBFusCATed on March 15, 2021, 01:35:14 AM
Modify your file associations command to use the --no-ipc option (use --help or /help to check which is the correct spelling for your OS).

(I don't know how to do that...)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

Settings->Environment->General settings->Untick Allow only one running instance
Settings->Environment->General settings-> untick use an already running instance

Elena

You really haven't read my post sigh... I said I have disabled them but they do not work

BlueHazzard

QuoteYou really haven't read my post sigh... I said I have disabled them but they do not work
Sry, but 90% the time this is the answer... And we answer 90% the same questions, so i get some automating going in my head... read the header, give standard answer...
Have you restarted codeblocks? This has never not worked for me on windows. On linux there was a bug, but i think we have fixed this...

BlueHazzard

Also if a restart does not work:
Are the settings saved?
Are other settings saved?

Elena

 ;D ;D
Yes I restarted. I even rebooted. And yep general settings are saved nicely...
By searching I found an old post of 2016 iirc where another user complained of the same issue and it turned out a bug (I reported it again), strange that it was never fixed in the meanwhile... :'(

BlueHazzard

Can you point (link?) to the complain?
The problem is, none of the devs (or other users) has reproduced this, so it has to be something very special with your machine....
Now is the big question how do we reproduce this problem on a machine of the devs...
Can you give us windows version (7,8...) Bitnes (32bit, 64 bit)
What exact version of codeblocks are you using? Where did you get it?

Can you open two separate codeblocks instances, by clicking on the codeblocks icon, or on windows 7/8/10 right click on the codeblocks symbol in the taskbar ->  codeblocks?

Elena

So... this was the thread I mentioned. It was marked as SOLVED but to me it doesn't quite seems so...
http://forums.next.codeblocks.org/index.php?topic=21350.0

I am using CB  20.03 downloaded from here
https://www.codeblocks.org/downloads/binaries/

I am on windows 7 x64 ultimate but I tried and under windows 10 x64 the behaviour is the same.
If I launch another instance by double clicking codeblocks.exe or by right click in the task bar it actually opens another instance, but not if I double click on a .cbp

Miguel Gimenez

The OP wants that double clicking on a .CBP file
Runs a new instance of the program. Currently you must
Open a new C::B and then
Load the project in the new instance using the menu.
Looks like a feature request, not really a bug.

oBFusCATed

It is clearly a bug. There are already options to enable this behaviour!
And there are previous reports for brokenness of this feature.
Someone with windows should investigate what is going on.

@Elena: Can you show us the contents of your registry for "HKEY_CURRENT_USER\Software\Classes\CodeBlocks.exe"?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Elena

Thanks Obfuscated, yeah to me it seems a bug without doubts because those two options (other than being apparently redundant imho) do not work. Also most times it is much more practical to open the .cbp rather than launching an empty CB locate the project and load it!
Anyway there is not any Codeblocks.exe key in my registry, there are many (.asm, .c,.cbp,...) but not the .exe... you really mean classes/codeblocks.exe ?

Miguel Gimenez

This is the content of my "HKEY_CURRENT_USER\Software\Classes\CodeBlocks.cbp" entry:


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp]
@="project file"

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\DefaultIcon]
@="C:\\Codeblocks\\src\\output31\\codeblocks.exe,1"

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell]

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\Build]

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\Build\command]
@="\"C:\\Codeblocks\\src\\output31\\codeblocks.exe\" -na -nd -ns --batch-build-notify --build \"%1\""

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\open]

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\open\command]
@="\"C:\\Codeblocks\\src\\output31\\codeblocks.exe\" \"%1\""

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\open\ddeexec]
@="[Open(\"%1\")]"

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\open\ddeexec\application]
@="CODEBLOCKS"

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\open\ddeexec\ifexec]
@="[IfExec_Open(\"%1\")]"

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\open\ddeexec\topic]
@="CodeBlocksDDEServer"

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\Rebuild (clean)]

[HKEY_CURRENT_USER\SOFTWARE\Classes\CodeBlocks.cbp\shell\Rebuild (clean)\command]
@="\"C:\\Codeblocks\\src\\output31\\codeblocks.exe\" -na -nd -ns --batch-build-notify --rebuild \"%1\""


If you remove the ddeexec folder all work as intended. IMHO this entry is redundant with the code, and in some tests it makes C::B freeze.