Mayayana
2/13/2011 2:28:00 PM
| That only seems to apply to ocx's and the same for MSDN 6a. I want to
| create a DLL.
|
Woops. I guess you're right. I started looking through
my installed COM libs. comct232.ocx, for instance, has
4 objects. Two are controls that require a license. Two are
not controls and don't require a license. I guess it breaks
down to classes rather than files/typelibs. Maybe it would
make sense to create your file as an OCX? As Matthew
Curland says in his book, "An OCX is just an ActiveX
DLL with a fancy file extension" (And with a handful of
different typelib flags/Registry settings). It would just
require that you offer a control to be sited on a form. That
only requires that the project use a form somewhere.
Lots of controls work that way: comdlg32, winsock, timer, etc.
It may also be feasible to
turn a DLL into a licensed ActiveX by editing the typelib
to mark your creatable class as requiring a license. But it's
hard to see where that would be worth the trouble, just
for the sake of getting a DLL instead of an OCX. And
I think an ActiveX license is just a long string in a Registry
key, anyway -- easily forged. The licensing
depends not on the sophistication of the method but rather
on the fact that people who use the controls commercially
want to make money, and for that they have to work legally.
If you just don't want others to freeload from your work,
and you're not actually selling a component, the limitations
of COMs alleged "self-documenting" feature should be
sufficient. A typelib, without docs, rarely provides enough
information to make an object usable. This topic has come
up before and some people have suggested using a red
herring extra parameter in function calls in order to make
the lib. unusable to the uninitiated as an extra security
option.
If you want to sell a DLL for others to use in their software
then it seems like a good idea to seriously think about
switching to OCX. Otherwise, how will your customers
deal with it? If they have an OCX their installer can just
register that. The security functionality is built into the
system. If instead you come up with your own protection
scheme then your customers will also have to use that
protection scheme. (In other words, if your DLL won't run
until it checks hardware or reads the Registry, then the parent
software is involuntarily hobbled by the same limitation.)