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

BlueHazzard

Yep, this is a problem with the DDE server in codeblocks.
I never hit this error, because i do not install codeblocks, or let it associate the file extensions and so i have not this registy entries
The easiest solution is to remove the ddeexec  from the registry...

Hopefully i find some time to look into it...

Miguel Gimenez

I have just posted a patch in ticket 1082, https://sourceforge.net/p/codeblocks/tickets/1082/. This patch does not create ddeexec entries (and remove them if they exist) when setting file associations.

Elena

@Miguel
If I delete the ddexec folder I simply have CB not loading a project the next time I double click on a .cbp, but it opens a requester saying:
Code::Blocks is not the default application for C/C++ source files.......
Why it does not work for me ?? As I said this at least happens on win7 ultimate x64, I can't test on another win right now

Miguel Gimenez

Quotewin7 ultimate x64
is the system I am using right now. The double click is handled by the CodeBlocks.cbp/shell/open/command folder. You must have something like this (the path to the executable will be different)


Windows Registry Editor Version 5.00

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

[HKEY_CURRENT_USER\Software\Classes\CodeBlocks.cbp\DefaultIcon]
@="C:\\Codeblocks314\\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:\\Codeblocks314\\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:\\Codeblocks314\\src\\output31\\codeblocks.exe\" \"%1\""

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

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


Elena

Looks pretty identical to mine.. except that I cannot delete ddexec otherwise cb opens the requester I described in my previous message,  and I have to confirm the associations otherwise I would lose them, and it rebuilds the ddexec

Elena

However if I launch it from a shell with a project name it opens a new instance effectively... but never if I double click on a .cbp!

Miguel Gimenez

You can try clicking right button on a .CBP and associate it with CodeBlocks.exe, other than that I can't help.

Here you have how ddeexec works: https://docs.microsoft.com/en-us/windows/win32/shell/how-to-associate-verbs-with-dde-commands

Elena

That requester is for nothing btw... even if you select to leave things as they are you have not lost the files association. It is clearly a bug there..you delete the ddexec and it goes nuts..the same requester opens at startup even if I change the the open/command key!! It is harmless but should not definitely open. Anyway I even tried to change the open/command key to [cb path] --multiple-instance "%1" but to no avail, it keeps opening .cbp projects in an alrrady running instance. And there things are buggy aswell, since in the title bar it remains the previous project name even if I click on the second project, and when you select Build you don't even know WHICH project it is building... with two projects opened in a single instance also I got a crash yesterday! If I wete the coder I'd have fixed everything already sigh2

Elena

In the end I managed to do it! Phew... I had to repeat the operation of deleting the ddexec few times, ignore the requester, reboot, and now apparently it opens all my .cbp files in separate instances 😃 It simply did not work at the first attempts....

BlueHazzard

You can disable the file association check in the options: Settings->Environment->Check&Set file associations (Windows only)
Anyway this is a bug and we will try to fix it

Elena

Well yes even because if I delete that key it has nothing to do with the files associations, clearly C::B makes some wrong assumption there. Thanks for your support

Miguel Gimenez

My patch also removes checking of ddeexec presence, so C::B will not complain on start.

MortenMacFly

Quote from: Miguel Gimenez on March 17, 2021, 09:38:57 AM
My patch also removes checking of ddeexec presence, so C::B will not complain on start.
Sorry, I didn't see this thread in advance so I answered to the ticket. I'll add my answer here, too for the record:

One note: From what I see this removes the DDE feature completely. DDE could also used on Windows to automate build processes, if properly used. So while this patch indeed fixes the bug mentioned but also removes the ability to script-control C::B from outside in case you really use just one instance (which is an option).

So this solution is not perfect... just my 2 cents here.

A better solution is to check if you are in single instance mode and then allow DDE commands. Additionally besides opening a file we could literally add any operation via DDE to kind of "remote-control" C::B. I do so for other applications at my work, also using the wx-DDE mechanisms with nice benefits.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Miguel Gimenez

No, the patch only removes automatic DDE calls when double clicking on an associated file. DDE is still there.