Craig Buchanan said:
What is the value of the VB6 Addin project over a regular COM object if I
simply want to expose 6 functions for use in Excel?
In SHORT though, the fact that it can be easily invoked from a toolbar
button. The main beauty of add-ins is that although possibly slightly tricky
and unintuitive to create, they *are* just that - an add-in - you can write
an 'extra-bit' to a standard, useful application like Excel - and seamlessly
integrate it with the running of that application. You can even use them for
patches - I recently had a problem with Word 2000, whereby it used to crash
whenever I used the mouse wheel. No warning, no tolerance - the second you
used the mousewheel on Word it would INSTANTLY throw a GPF. No questions
asked. No amount of installing the latest mousedrivers, using a different
mouse or restarting the machine worked - until I had the idea to write an
add-in that subclasses whatever window has the focus and just see if I could
get it to ignore the WM_MOUSEWHEEL message. I thought it wouldn't work as I
was going to intercept it and pass the CallWindowProc function the
WM_VSCROLL instead - but that didn't work as I couldn't figure out how to
determine the correct parameters for WM_VSCROLL. So I thought, well doing
nothing would be better than crashing. So, trying my luck, I simply put an
'Exit Function' in the case of any WM_MOUSEWHEEL messages, so it exited and
returned zero without calling CallWindowProc. And sure enough to my
amazement, not only did it stop it crashing, but the mousewheel worked
perfectly! And it does anytime the addin is loaded, but not when it isn't -
so it always is, and it's obviously the work of the addin that prevents it
from crashing. My only conclusion is that XP sends messages to parent
windows and child windows, while Windows 2000 (which Word 2000 was designed
to run on) sends messages to only child windows (Word and Excel have three
levels of windows, even though Word 2000 is an SDI app) and I can only
presume that Word 2000 was only programmed to handle messages to one of its
windows, and was getting in some sort of deadlock situation, but Word XP
would be able to handle the multiple messages that its operating system
sends. No prize for guessing what MS's solution to my problem would have
been!