Distributing DLL's for Sale (VB6)


Wondering if anyone has a "code" solution on how to distribute COM DLL's compiled with VB such that they can be licensed. Licensing COM objects appears to be VERY different from Licensing an ActiveX object.

To clarify, some examples are (pretty much every COM/DLL reseller on the planet like XceedSoft, WeOnlyDo, etc).

Object works like this:

License / Key can be purchased from Said company, so it is something that can be generated server side.
Object has a function called  .License() which accepts one or two parameters (depending on system) which are "Name" and "License Key" or just "License Key"

Upon successful call of this ONCE (and then you can remove it  from your code), the component is then licensed to the developers PC permanently.

After which, any projects the developer adds the component to, can be compiled and distributed without ever calling the .License function again, and without any trial messages/etc on the client side.

If however, the .License function was NEVER called, then all distributions will then show the "trial" message on the developer PC AND on all client machines the component was distributed to.


Now, for whatever reason, what should have an abundant source of documentation, seems to be a complete mystery and/or closely guarded secret.  I am thinking NOW that VB6 is officially no longer in distribution, that someone who has EVER implemented a license mechanism (NOT Wrapper code like SoftLocx, etc) would be so kind as to cough up the details --- PLEASE!!!

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

microvbAuthor Commented:
It would seem that the community at large doesn't wish to give up this information --- not sure whats so special about it, but I am gonna close this as unresolved as this is one question that will NEVER be answered.

Sadly, there is a solution, but sorry EE, your not "special" enough to host it apparently.

Cheers and to the dev community hoarding the solution ---- GO SUCK A CAMELS NOSE!!
Ryan McCauleyEnterprise Analytics ManagerCommented:
If somebody was willing to help you out (and the lack of response isn't just a result of narrow question categorization), I don't know that your attitude is going to help you get it answered. Just saying.

Anyways, I've never implemented a license scheme like this on a VB6 component, but have you tried contacting one of the companies that sells a component licensed like this and seeing if you can get in touch with somebody who you know has done it? I know the company wouldn't officially support helping you, but maybe you can get in touch with one of their developers and ask (nicely) to be pointed in the right direction. If people have been doing this for 15 years (how long modern VB classic has been around), I'm sure there are plenty of people who have done it. It's amazing what a friendly phone call and some flattery can do - I'd be hard pressed to turn down somebody who contacted me and asked for some assistance with something I'd done before, especially if published knowledge is legitimately light.

Maybe you're just frustrated from the lack of easy to find knowledge and you've been searching for a while, but I doubt it's a closely guarded secret, since there are dozens of components that are licensed in this way, so it's not proprietary. My point is that the attitude isn't going to help find an answer.
microvbAuthor Commented:

Thanks for the tip, however I have contacted several of these companies. Some with no reply at all -- others won't give it up because it has to do with their licensing, claiming security blah blah ..... and some other companies are like sure, we can write a component that will do it for $30,000+ ...  etc.

I am sure if you did even a bit of digging through all the popular source repo's, including some of the newer ones, you too will be unimpressed with the results.

My attitude you see in the post above, was really just a response to the lack of response --- everywhere, when a politely written article that details things out in such a way that reduces such random comments like:

1. It's not possible.
2. Have you tried XYZ wrapper.
3. Why aren't you using .NET   (aka... same problem is posed there for distribution of COM objects).
4. Use  "Licenses.Add"
5. .... insert other non-useful comment here.

I respect that people give there time to hail responses, and time is valuable --- just sort of felt that my contributions to the community aren't exactly small --- for free.

I know there is a solution, and yes, it does seem to be something closely guarded, which when i responded to the thread -- that is the honest to god's answer to this question. ---- There is no solution because it is not being given out by anyone.

Not sure what the big deal is about this --- the community at large could use this and it would perhaps spurt some more life into current products.

In any case -- I am not super keen on those who hoard information --- especially not in this era, and the amount of information I have given freely into the community.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

>>"Cheers and to the dev community hoarding the solution ---- GO SUCK A CAMELS NOSE!!"
That's totally uncalled for. Sorry if the companies you contacted ignored you, and you felt ignored after only a couple of days here without an answer, but maybe, just maybe the person you needed to read this and provide an answer was busy. And after they read your comments they'll just move on now instead of helping...

That said, don't know if this helps or not, but here it is:

Have you looked into this?
It's only $60 and you don't need to reinvent the wheel....

Or have you seen this?
The process talks about ActiveX, but they are doing this in VB so I'm sure you could adapt to your dll.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
microvbAuthor Commented:

I agree it was uncalled for, and was the result of angry typing.

The $60 solution seems worthwhile to look into. The downside looks like like it requires manual generation of the license keys. Will look into it deeper.

As for the microsoft solution, yes, I have seen that in many places -- a $250 call to Microsoft confims that is only applicable to ActiveX (.OCX) components and for DLL's it is a different method which they did not disclose or even a reference to documentation.
Hi microvb,
Take a look at this MS article:
IClassFactory2 interface
microvbAuthor Commented:
@eemit : Unfortunately due to the way automation works in VB, those classes are unavailable --- additionally, there is very little (no more than a few lines, or a list of the functions) available.

@p912s : See attached image for the result of my purchase of vb-ware.com's application. My bad as I should have tested it before buying, but, at least PayPal has a decent refund process. Tried to use their contact form (broken), and there doesn't seem to be any other way to get in touch with them.
microvbAuthor Commented:
Following up, can force the DLL to register using administrator command prompt, however, it comes up with an automation message afterwards --- all run-times are installed.

Success on forced registration of DLL
Demo application or USE of DLL still fails with an automation error.
Hi microvb,
Demo application or USE of DLL still fails with an automation error
On a 64-bit version of a Windows operating system, there are two versions of the Regsv32.exe file
The 64-bit version is %systemroot%\System32\regsvr32.exe
The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe

(The Syswow64 folder contains the 32-bit versions of Windows program files and DLLs)

Run Regsvr32.exe from the %SystemRoot%\Syswow64 folder.
For example, type the following commands to register the DLL

cd \windows\syswow64
regsvr32 c:\filename.dll

You also need 'Run as Administrator'.
microvbAuthor Commented:
Executing the following in an Administrator command prompt results in nothing registering.

C:\Windows\SysWOW64>regsvr32 "c:\Program Files (x86)\VBWare\License DLL\VBWareLicenseDLL.dll"

Open in new window

64bit RegSvr32 fail example
I do appreciate the feedback, however this is another great example on how junk these programs are. They always fail at some point ---  This particular one, would result in a very poor user experience from the perspective of dependence on a DLL which has a poorly constructed container.

This is why I was looking more towards a code only solution to this problem using a set of API's that is accessible to VB. I have no issues with any of the DLL's that I create registering on systems from 95, through to Windows 8. (By no issues, I mean, they run fast, no mem leaks, and all register correctly when used -- in fact, they can operate without registration when placed in the same folder as the application which require it -- thus bypassing dependancy nightmares of previous OS's).

Thank you for reminding me about the x64 version of regsvr32. If I am not mistaken, on Windows 7, using c:\windows\system32\regsvr32.exe will call c:\windows\syswow64\regsvr32.exe  where required by 64bit components. Since this is not a 64bit component, it goes without saying that is most likely the reason it did not register with c:\windows\syswow64\regsvr32.exe .... it did register with c:\windows\system32\regsvr32.exe .

I also tried the old trick of placing the runtime inside the application folder, and further, disabling UAC in an attempt to troubleshoot (something I would not be able to request for people to do --- my COM will operate fully with UAC enabled).

This leads to another frustrating point --- clearly the developers of these wrappers / external components are not very skilled (resulting works as proof), so it really irks me that this information has been made available to them.

Feelings aside, it would be fantastic to find a final solution to this decade long issue. It may sound like I am simply shooting down your comments -- I can assure you this is not the case. I am most definitely a skilled coder with over 30 years experience, to which a solution to this problem has eluded me.

Today (not as in immediately today, but  as definition of an era), I hope we can work together to find a viable solution. I am also looking into this in my space time, and having multiple sets of eyes on the prize, there should be no reason to find a solution given that one actually does exist :)

microvbAuthor Commented:
I was able to contact the provider at VBWare and they have resolved the issue with the component as there was a glitch in the compile.

VB-Ware looks to be a viable solution so I will close this off and mark the points out accordingly.

Thank you to everyone for your responses.
microvbAuthor Commented:
The correct answer and final solution is: "Have you looked into this?
It's only $60 and you don't need to reinvent the wheel...."

The other URL "http://support.microsoft.com/kb/274754"  is ONLY for ActiveX (OCX) and can not be implemented into COM (DLL) or Applications (EXE).
microvb - good to hear they responded to you and were able to correct the problem.

Good luck and thanks for the points!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.