News:

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

Main Menu

File association to registry fails?

Started by MortenMacFly, January 03, 2006, 10:25:43 AM

Previous topic - Next topic

MortenMacFly

Dear all,
due to a computer crash I had to re-install everything from scratch. I compiled rev. 1648 and run it but I encounter problems with setting the file association. After the question: "Code::Blocks is not currently the default application for C/C++ source files Do you want to set it as default?" I receive a lot of errors like:

10:06:05: Can't create registry key 'HKCR\.cbp' (error 5: access denied)
10:06:05: Can't open registry key 'HKCR\.cbp' (error 2: file not found)
10:06:05: Can't set value of 'HKCR\.cbp' (error 2: file not found)

when I click OK. Please notice that I am no longer an administrator on my machine (I am a power user by now) and that the path to the registry is not correct. Instead "HKCR\.cbp" it should be something like: "HKLM\.cbp". But there I might have no access, which should be taken care of anyway (I believe). Can someone confirm this issue?

Morten.
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]

MortenMacFly

Additional info:
I ran CodeBlocks as an admin for one time by now. The file association works then - the keys are registered correctly under HKLM. But when I start CodeBlocks after that as a power user again I receive the same errors as before. This leads to the question: Why is (obviously) HKCR being checked and tried to be modified if I run as power user and HKLM (the correct one) only if I run C::B as admin? Shouldn't HKLM be the only one key to be read/modified for the file association to work?
Morten.
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]

killerbot

It's because you are not admin !
I have created a patch (assigned it to Thomas, so if you kindly ask him, he might apply it ;-)  )
See here :
http://forums.next.codeblocks.org/index.php?topic=1793.msg13435#msg13435

Patch you can find at sourceforge and the in the forum topic , listing the community patches.

Lieven

thomas

He might not, because he knows too little about the magic incantations of the registry and he is afraid of completely breaking it. :lol:

From what he has read in another thread, there seems to be a user section in Windows98, but apparently it is not used...?
Until someone who really knows how to make it work on every system, Thomas is very reluctant to touch anything, lest it breaks for the systems where it works, too.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

killerbot

That's true Thomas.
Can anyone with WIN98 try the patch out please ???

Making the patch a bit more complicated I could check on the windows version, but would be nicer if it already works as it is now.

Cheers,
Lieven

grv575

Quote from: MortenMacFly on January 03, 2006, 10:25:43 AM

10:06:05: Can't create registry key 'HKCR\.cbp' (error 5: access denied)
10:06:05: Can't open registry key 'HKCR\.cbp' (error 2: file not found)
10:06:05: Can't set value of 'HKCR\.cbp' (error 2: file not found)


shouldn't that be HKCU?

killerbot

HKCR : class root
HKCU : current user

It should be CU, well in more modern windowsez, but we have to make sure it also works on win95/98/Me/NT4 

So my simple patch at this moment looks if the
user key exists, if so -> put the stuff there (so that fixes win 200 /xp /2003), and if that one does not exist, put it at class root.
For this to work : the other os's should not have the user key.
It seems Win98 does has it, the BIG question is, if we also store the info at the user key, will it be used by the OS.

It seems the user key was only added in win2000, but it is possible the older os's also have because of upgrades ??

Note : we have not played all our cards yet, so if this simple fix does not work I can explicitly go check on the windows version.

Lieven

grv575

Well, windows2000 is a merge of win98 features on top of nt.  So it could be that win98 had it first and then it was added to win2000.  I'm pretty sure that it would work if it's present.

killerbot

We are going to do a test on win98 soon with my patch.
So I will provide a special build for that, there are 2 open questions :

1) who added the DDE stuff to the associations.cpp -> as mentioned in another post, this is "probably" NOT needed, the command entry is sufficient, and this is the cause of the "double click on a cbp file" bug.

2) what is that extra library I need to linkt with so that the svn builds work on Win98 ? And will those ancient windows versions run an unicode build ??

thanks for the info,
Lieven

mandrav

Quote from: killerbot on January 04, 2006, 09:16:45 AM
1) who added the DDE stuff to the associations.cpp -> as mentioned in another post, this is "probably" NOT needed, the command entry is sufficient, and this is the cause of the "double click on a cbp file" bug.

I did. DDE is useful when you want to re-use an already existing instance (i.e. not start a new instance of C::B).
Be patient!
This bug will be fixed soon...

killerbot

Do you think we really need it Yiannis, that DDE ? I checked some other software (adobe, firefox, skype, ..), they all seem to stick to just the command stuff.
Do you mean by this, if you have two 2 different cb exe's on your pc, both will use the same settings, cause what i see now is that there's a ping-pong game going on between the devel-exe and the output-exe.

Quotewould you be so kind and add SHFolder(before Shell32) to the link libraries of the sdk target for your builds - then Codeblocks could be used on W98 again.
Yiannis, is this something that always can be added ? Or does it create conflicts on the non win98 builds ? If it can always be added, then we have a build that also works for win98/95, otherwise we need a special build/target for those 2 platforms.


Lieven

thomas

Quote from: killerbot on January 04, 2006, 09:57:34 AM
Do you think we really need it Yiannis, that DDE ? I checked some other software (adobe, firefox, skype, ..), they all seem to stick to just the command stuff.
If you have a solution that can do without DDE then please step forward.
DDE never really works 100%, so I would be very happy to see it gone. But if you don't use DDE, then how do you get documents which you double-click in Explorer to open in the already running instance instead of starting a new one?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

killerbot

#12
Ah, thanks, that's what it is for.

Have done some searching in the meantime.
At my system : .html --> FireFoxHtml -> only command
When I click several .html files in explorer thay all open up in the same firefox (in sereperate tabs).
I can manually start several Firefox'es by clicking on the program icon of firefox. So it's not that only one instance can exist. Wonder how they do that ? Any experts around here ?

I have installed as a text editor editpadlite (www.editpadlite.com), which handles the .txt files -> all open up in the same editpadlite (I think this one only allows one instance of it's application, so might be easy like that).


Note : I don't have anything against the DDE, but when you double click the files CB should handle and you get that annoying error message, then I'd suggest that we take it out for the moment, since it does not give a solid user experience.
[EDIT] well as long as RC3 is not out, it does not yet give the 'official' users this bad experience

Lieven

Der Meister

Quote from: killerbot on January 04, 2006, 11:45:07 AM
I can manually start several Firefox'es by clicking on the program icon of firefox. So it's not that only one instance can exist. Wonder how they do that ?
I don't know what firefox uses, but creating a named mutex is another common technique to allow only one running instance.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Urxae

Quote from: killerbot on January 04, 2006, 11:45:07 AM
Have done some searching in the meantime.
At my system : .html --> FireFoxHtml -> only command
When I click several .html files in explorer thay all open up in the same firefox (in sereperate tabs).
I can manually start several Firefox'es by clicking on the program icon of firefox. So it's not that only one instance can exist. Wonder how they do that ? Any experts around here ?

I'm by no means an expert, but it seems Firefox always starts an extra instance.
Presumably it then signals the existing instance somehow, because that one then opens the file or empty window, while the extra instance closes.