Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: tiwag on December 07, 2005, 04:48:55 pm

Title: Windows file associations - shell integration
Post by: tiwag on December 07, 2005, 04:48:55 pm
since the last modifications with file associations (windows only) i got permanent errors when
i doubleclicked a CodeBlocks-project file ( *.cbp) or -workspace file ( *.workspace) in the windows-explorer.

The error message was, that the double-clicked file could not be found -  but CodeBlocks was started and opened the correct file - mysterious  :shock:

i could resolve this behaviour by deleting all ddeexec registry keys in the
regarding Codeblocks file-association registry keys like
Code
HKEY_CLASSES_ROOT\CodeBlocks.cbp\shell\open\command\ddexec
HKEY_CLASSES_ROOT\CodeBlocks.workspace\shell\open\command\ddexec

Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 05:02:27 pm
I have the same error message when double clicking on a cbp file (no tried it on workspaces).

And something else I have, all the time cb asks me to become the default application for c/c++ source files. And each time I click on yes,but it does not seem to remember it, or does omeone steal it behinds it's back all the time ?? Well in the past it worked, so I suspect the cause is in the new CB builds somewhere.
Title: Re: Windows file associations - shell integration
Post by: thomas on December 07, 2005, 05:05:57 pm
I've seen that too, but I don't think it is an actual bug. Everything works fine if the registry contained nothing before, and it never happens again after you delete them, either.
It only seems to happen when you add one registry key to an existing set... no idea what's going on there, but it looks like Windows SNAFU.

There's another funny thing that can happen in that context, too. You can get two instances of Code::Blocks to continuously fight over who is the default application and end up having one file type open in one instance, and another in the other. I haven't figured how, when, and why that happens either. Actually it cannot happen...
Title: Re: Windows file associations - shell integration
Post by: takeshimiya on December 07, 2005, 05:07:36 pm
Supossedly this was fixed (I think) in Rev 1445 (http://svn.berlios.de/wsvn/codeblocks/?rev=1445&sc=1).
Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 05:09:31 pm
seems not, I used a fresh build from today's head revision.
Title: Re: Windows file associations - shell integration
Post by: tiwag on December 07, 2005, 05:16:26 pm
i only wanted to let you know how you can get rid of this error.

maybe it would be the correct way, that the next release of CB deletes these ddeexec subkeys when it writes the others in it , because it is most likely, that someone that had CB RC2 installed has already these ddeexec registry entries and will then get these annoying errors when updating...
Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 05:17:59 pm
just checking : it is absolutely save to remove those entries ??
Just for cbp and workspace or fall all codeblocks.xxx types ?
Title: Re: Windows file associations - shell integration
Post by: tiwag on December 07, 2005, 05:20:06 pm
Supossedly this was fixed (I think) in Rev 1445 (http://svn.berlios.de/wsvn/codeblocks/?rev=1445&sc=1).


Supposedly maybe ...   :)

( sorry - coudn't resist )
Title: Re: Windows file associations - shell integration
Post by: thomas on December 07, 2005, 05:20:54 pm
You can delete everything that looks like CodeBlocks.extension without breaking anything.
Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 05:26:00 pm
I deleted all codeblocks.extension  as Thomas said.

Then I started my codeblocks : -> the question aout becoming default app fo c/c++ sources --> yes.
Closed CB.

Double clicked on a cbp file ==> error message is still there and CB again asked to be default app ...

Seems the registry hack does not help :-(
Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 05:28:40 pm
well , it's not quit the same as tiwag said, I check the registry again, and all are back, together with that ddeexec.
New test :
Removed just that one from registry for example  cbp file ---> the error message is gone (still Cb asks to become default app ....)
Title: Re: Windows file associations - shell integration
Post by: tiwag on December 07, 2005, 05:30:09 pm
... still Cb asks to become default app ...

say NO one time, then edit the registry and you are healed
Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 05:31:51 pm
which part of registry ??
Title: Re: Windows file associations - shell integration
Post by: tiwag on December 07, 2005, 05:36:57 pm
which part of registry ??
please look at the first post  :D only delete the ddeexec and all subsequent keys
Title: Re: Windows file associations - shell integration
Post by: thomas on December 07, 2005, 05:41:48 pm
I think it has to do with DDE as such... The error also appears (sometimes) when a second file is opened while the first instance of Code::Blocks is still initializing. It does not recur after you have closed Code::Blocks though (so apparently the registry is not modified).

And worse: Try doubleclicking a .cbp twice really fast (quadruple-click, so to say). If you are "lucky", you manage to launch two instances which are both unresponsive, and Explorer freezes up, too....  :shock:
Does not happen without DDE server.
Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 05:42:51 pm
I know, but dos it help also for default app ??

Well, I have now deleted all those ddexec's, and somehow they all came back. Seems it's best not to do it for all extension, probably just the cbp and ???
Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 05:45:39 pm
and I also have it with cpp files :-( :-(

almighty Yiannis please fix this ....
Title: Re: Windows file associations - shell integration
Post by: tiwag on December 07, 2005, 05:46:44 pm
... I have now deleted all those ddexec's, and somehow they all came back. Seems it's best not to do it for all extension, probably just the cbp and ???

sorry, then i don't know - i have deleted all of them too and they didn't come back on my WinXP system and i get no more errors  :D :D :D
Title: Re: Windows file associations - shell integration
Post by: thomas on December 07, 2005, 06:01:44 pm
I deleted all these:
(http://img511.imageshack.us/img511/7912/reg7eo.png)

and from that point, it all worked fine. It is safe to delete these, Code::Blocks writes them out if you click on "Set Now".
Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 06:31:27 pm
Just to make sure, there's no conflict with my also installed RC2, I removed RC2, and let's it remove all settings from the registry (probably the old stuff in the regisrty), since the stuff we are talkin about here remains, then I deleted them manually again.
On a previous run i answered no to the default app question.
So now, nothing is linkde to CB, not even the cbp files.

Open CB, Environment settings : set now. (keeping the Check&set file associations (windows only) unchecked).
Close CB.

Double click on a cpp file, CB opens it, but the error message is back :-(  :cry:
I am going nuts.

Title: Re: Windows file associations - shell integration
Post by: tiwag on December 07, 2005, 06:49:56 pm
@ killerbot

check, if you have the dde server extension registered at the base class registry entry of the extension

i.e.
Code
HKEY_CLASSES_ROOT\.cbp

there should be only the standard entry

Code
@="CodeBlocks.cbp"

maybe you've registered the dde-server extension there too.
Title: Re: Windows file associations - shell integration
Post by: killerbot on December 07, 2005, 07:50:41 pm
I only have the default entry at that point, so that seems ok.
Title: Re: Windows file associations - shell integration
Post by: tiwag on January 04, 2006, 06:01:47 pm
in the meantime i found out more information about this issue and will give a summary of the necessary steps in order to get rid of these dde "file not found" error under windoze OS.

1.) start codeblocks, go to Settings->Environment->General and
check "Run DDE server"
check "Check & set file associations"
press the button "Set now"
uncheck "Check & set file associations"
close codeblocks

2.) go to the registry entries
HKEY_CLASSES_ROOT\CodeBlocks.cbp\shell\open\command\ddexec
HKEY_CLASSES_ROOT\CodeBlocks.workspace\shell\open\command\ddexec
...(and their companions)...

delete all ddexec keys with their subkeys.

3.) never ever (until this bug is fixed by some windoze spezialists)  allow CodeBlocks to check "Check & set file associations" again
 you get asked every time when you create a new profile, always say NO

now you should be able to doublecklick on any *.cbp, *.workspace, ...  file and it opens with CB fine.

HTH  :)


[edit]
sample of registry for *.cbp and *.workspace files
how it looks when it's work(around)ing

Windows Registry Editor Version 5.00


[HKEY_CLASSES_ROOT\CodeBlocks.cbp]
@="Code::Blocks project file"

[HKEY_CLASSES_ROOT\CodeBlocks.cbp\DefaultIcon]
@="D:\\Programme\\CodeBlocks\\codeblocks.exe,1"

[HKEY_CLASSES_ROOT\CodeBlocks.cbp\shell]

[HKEY_CLASSES_ROOT\CodeBlocks.cbp\shell\Build]

[HKEY_CLASSES_ROOT\CodeBlocks.cbp\shell\Build\command]
@="\"D:\\Programme\\CodeBlocks\\codeblocks.exe\" -na -nd -ns --batch-build-notify --build \"%1\""

[HKEY_CLASSES_ROOT\CodeBlocks.cbp\shell\open]

[HKEY_CLASSES_ROOT\CodeBlocks.cbp\shell\open\command]
@="\"D:\\Programme\\CodeBlocks\\codeblocks.exe\" \"%1\""

[HKEY_CLASSES_ROOT\CodeBlocks.cbp\shell\Rebuild (clean)]

[HKEY_CLASSES_ROOT\CodeBlocks.cbp\shell\Rebuild (clean)\command]
@="\"D:\\Programme\\CodeBlocks\\codeblocks.exe\" -na -nd -ns --batch-build-notify --rebuild \"%1\""




[HKEY_CLASSES_ROOT\CodeBlocks.workspace]
@="Code::Blocksworkspace file"

[HKEY_CLASSES_ROOT\CodeBlocks.workspace\DefaultIcon]
@="D:\\Programme\\CodeBlocks\\codeblocks.exe,1"

[HKEY_CLASSES_ROOT\CodeBlocks.workspace\shell]

[HKEY_CLASSES_ROOT\CodeBlocks.workspace\shell\Build]

[HKEY_CLASSES_ROOT\CodeBlocks.workspace\shell\Build\command]
@="\"D:\\Programme\\CodeBlocks\\codeblocks.exe\" -na -nd -ns --batch-build-notify --build \"%1\""

[HKEY_CLASSES_ROOT\CodeBlocks.workspace\shell\open]

[HKEY_CLASSES_ROOT\CodeBlocks.workspace\shell\open\command]
@="\"D:\\Programme\\CodeBlocks\\codeblocks.exe\" \"%1\""

[HKEY_CLASSES_ROOT\CodeBlocks.workspace\shell\Rebuild (clean)]

[HKEY_CLASSES_ROOT\CodeBlocks.workspace\shell\Rebuild (clean)\command]
@="\"D:\\Programme\\CodeBlocks\\codeblocks.exe\" -na -nd -ns --batch-build-notify --rebuild \"%1\""



Title: Re: Windows file associations - shell integration
Post by: killerbot on January 05, 2006, 02:56:35 pm
uninstalled RC2 on my work machine (== pc @ work), and put there the latest nightly build.
CB wants to associate with cpp/other files -> do it.

cbp file is registered (double clicking on them even without the error message box, well well, some work others don't), but CPP files remain in the hands of ............DEV-CPP (even if CB is aalready open or not).

Hmm, this is really haunting me, this is Freddy 15, Jason 21, Halloween 78, Night of the living file types, ....

Yiannis, did you put some special trick in dev-cpp in the days, so no one could get the file association away from it ;-)
(though, on the other systems I also have dev-cpp).

Note , on my work pc I already had the problem with RC2.

[EDIT] it was able to take the headers

Lieven
Title: Re: Windows file associations - shell integration
Post by: thomas on January 05, 2006, 03:10:19 pm
Look in
Code
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.c\OpenWithList]

On my machine, I find Dev-CPP everywhere in there, even though it is gone for many months now, and it is the default handler for some types (.c for example).

Maybe we need to write an UnDevCPPizer tool that deletes all these keys...
Title: Re: Windows file associations - shell integration
Post by: rickg22 on January 05, 2006, 06:21:26 pm
I second! :) After all, if the user chooses to register the filetypes, it means he got rid of dev. And if he wants to go back to dev (which i doubt  8) ), dev will restore its filetypes.