ralph
12/12/2011 4:02:00 AM
On Sun, 11 Dec 2011 13:42:20 -0800, BeeJ <nospam@spamnot.com> wrote:
>Finally go it working the way I want as both an in-project UC and a
>stand alone UC .ocx.
>
>But can someone explain what the differences are beside:
> (1) .ocx is "portable" but has to be installed with an app.
> (2) .ocx update affects all app usage.
> (3) in-project is not neatly in project list if the UC uses classes
>and modules.
> (4) in-project won't break another app when UC code is
>"fixed/revised".
>
I would also add to #3 that it is too easy to add project-specific
dependencies to a UC making it even more complicated to split out the
code should one chose to later package the UC into a free-standing
OCX.
But what I find disturbing about your list is #2 and #3. Neither of
these conditions need ever happen.
The first rule of COM is that a published interface is chiseled in
stone. If you change the interface then you have a new object. Obey
that rule and you will avoide "Dll Hell". It is that simple.
For example, Given a situation where two programs (App1 and App2) are
using OCX1.
1) You decide to modify OCX1's interface. Add the new interface to
your OCX. Call it OCX2.
App1 and App2 continue to use OCX1. Any newer Apps can use OCX2. If
you want to use OCX2 in the older apps then you will have to
re-compile, but that is no different that what you would have to do if
you planned on changing an internal UC.
No problem with any installs - you are still shipping the same
component (only its newer).
2) You decide to improve the internal workings of OCX1, ie, the
interface doesn't change.
Open the OCX, making sure to maintain binary compatiblity, make your
changes and recompile the component.
Both App1 and App2 benefit immediately from the changes - no
re-compile is necessary.
No problem with any installs - you are still shipping the same
component (only its newer).