PDA

Click to See Complete Forum and Search --> : Adding controls dynamically & licensing issue


crocogator
Mar 26th, 2001, 02:49 AM
Hi,

I need someone to help me figure this out because I tried everything possible that I know, but without any success. What I am trying to do is to add controls dynamically to a form during runtime from within an Activex DLL class. I am able to add all the controls that come along as default with the VB 6 Professional. Version. But I am unable to add control like TABSTRIP. This is what I have been doing.

One way that I have tried:

- Unchecked the “Remove information about any unused Activex controls” from the “Make” tab of the project properties

- From within the class I get the License info of the control using Licenses.add() function

- From within the class I add the license info to the Licenses collection using the Licenses.add “mscomctllib.tabstrip”, “licenseinfo”

- Then I try to add the control to the form as follows.
Set tbstrip = form1.controls.add(“mscomctllib.tbstrip”, “tbstrip”)

When I run the program, it does not even reach the last step, instead it gives me an ‘Run time erros 731” when it executes the ‘Licenses.add “mscomctllib.tabstrip”, “licenseinfo” fuction. The error message is that the license information already exists in the licenses collection.

Could someone help me out here please, cos I have been trying to get this thing done for almost 2 months now. I tried adding the control the normal way, that is : by declaring a Tabstrip variable and then using the form.controls.add method, but then it gives me an error saying “To add any activex control, first you have to retrieve & add the License information” which is what I did and got the error that I mentioned first. Either way I am getting into an indefenite kind of loop of error (one says to add the license info and the other says that the license info already exists in the licenses collection)

Some one pllllllllllllllllllllllleeeeeeeeeeeeeeeeeeeeeasssssssssssssssseeeeeeeeeeeeeee HELP!!!!HELP!!!HELP.

Thanks & Rgds.
Raj