On the startup of an OLE server the TOcRegistrar constructor tries to update the LocalServer32 registry entry even if no registration option is set. This fails if user rights are not sufficient — silently in older versions, but terminating with an exception now. As a result, OLE servers cannot be run as a non-server application without admin rights.
As a possible cause for this change in behaviour I found the removal of the condition that exceptions are not thrown when TXBase::InstanceCount > 0 in TXRegistry::Check. See "TXBase::InstanceCount is not thread-safe" [bugs:#176].
Bugs: #176
Bugs: #498
Discussion: State of OCFNext — time to discontinue?
Discussion: OWLNext 6.44 Beta and work on OCFNext
Discussion: OWLNext 6.44 Beta and work on OCFNext
Wiki: OWLNext_Stable_Releases
Last edit: Vidar Hasfjord 2017-03-10
I can see two solutions to this issue:
a) Supressing exceptions due to access violations within the TOcRegistrar constructor.
b) Abandon server registration unless explicitely specified as a command-line option.
I personally would prefer solution b) although it breaks with traditional behaviour.
This traditional behaviour might have been introduced to allow to omit registration during installation. But nowadays there are lots of installers handling this task easily. And also, manual registration by a user will fail in most cases anyway.
Are there differing opinions?
Hi Erwin,
I don't have a differing opinion, but here are some thoughts on the options you presented.
I recommend you ensure that runtime behaviour is the same as before for existing client code. However, if you really want to change the default behaviour, I recommend you make it so that old code breaks, i.e. so that old code reliant on the old default behaviour wont compile, thus alerting the users to the changed behaviour and forcing them to adapt the client code.
To get the best of both solutions, you can add a parameter to the TOcRegistrar that configures how it deals with this registration issue, with a default argument that configures the constructor to behave the traditional way.
From time to time one wonders why one did not come to it himself.
In general I agree and I did it this way [r3784]. But I'm not sure if this is the best way here. It might be better to add the parameter in a way that a compiler error will occur, i.e. directly after 'cmdline', not at the end of the list.
By accident I have also commited "source\owlext\calcedit.cpp". Please cancel if already fixed.
Related
Commit: [r3784]
Hm. Having looked at your revision, it seems to me that the default behaviour is now to throw, i.e. a change of behaviour compared to traditional behaviour. Does that mean that you now consider the traditional behaviour, i.e. the failure to throw, a bug?
I tend to agree — presuming there is a change of behaviour now. That said, I am not in a position to have a strong opinion either way.
Thanks for noticing and fixing this regression. I have supplemented the log message for [r3784]. Note that you can edit log statements in the TortoiseSVN log dialog (right click).
Last edit: Vidar Hasfjord 2017-03-22
I do so, at least in some way. But the reason I chose to throw by default was:
a) This preserves the behaviour as it is now - seems that I missunderstood you here.
b) Setting the default behaviour to not throw would also apply when registration options are given in the command line.
I moved the new parameter in front of 'cmdLine' now to force a compile error [r3785].
Related
Commit: [r3785]
I have now merged this fix into 6.44 [r3929]. The fix was released in OWLNext 6.44.1.
Related
Commit: [r3929]
Last edit: Vidar Hasfjord 2026-04-03