We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

My own ActiveX DLL, huh ?!

michelv
michelv asked
on
Medium Priority
267 Views
Last Modified: 2010-05-03
Okay,

Hi, I wrote a Hierarchical tree Class that consists of:

HTree  -  Main Class
HNodes -  Nodes Collection
HNode  -  The Node

This Class works exactly like the TreeView1 control, except it has no visual interface, it's just the datastructure.

The Class works fine when I add the .cls files directly in the Project. But I want to make an ActiveX DLL of this class. The Class Compiles, I make a new Project, add a reference to the newly created ActiveX DLL and load the exact same code I used to test the class before it was compiled. Now comes the problem:

Run-time error 450
Wrong number of arguments or invalid property assignment

The creation of the object doesn't generate this error, it happens here:

Private Sub Form_Load()

    Dim nde     As HNode
    Dim Network As New HTree
   
    Set Network.Nodes.TreeView = TreeView1
   
    Set nde = Network.Nodes.Add(Key:="Root", Text:="Root")

>> At this line !!!    
    Set nde = Network.Nodes.Add("1st level Child 1", nde.Index, ndeChild, "1st level Child 1")
   
    Set nde = Network.Nodes.Add("2nd level Child 2", nde.Index, ndeChild, "2nd level Child 2")
   
    Set nde = Network.Nodes.Add("2nd level Child 1", nde.Index, ndePrevious, "2nd level Child 1")
   
    Set nde = Network.Nodes.Add("3rd level Child 3", nde.Index, ndeChild, "3rd level Child 3")
   
    Set nde = Network.Nodes.Add("3rd level Child 2", nde.Index, ndePrevious, "3rd level Child 2")
   
    Network.Nodes.Add "4rd level Child 3", nde.Index, ndeChild, "4rd level Child 3"
       
    Set nde = Network.Nodes.Add("3rd level Child 1", nde.Index, ndePrevious, "3rd level Child 1")
   
    Set nde = Network.Nodes.Add("4rd level Child 1", nde.Index, ndeChild, "4rd level Child 1")
   
    Set nde = Network.Nodes.Add("4rd level Child 2", nde.Index, ndeNext, "4rd level Child 2")
   
    Set nde = Network.Nodes.Add("5th level Child 1", nde.Index, ndeChild, "5th level Child 1")
   
    Set nde = Network.Nodes.Add("Root 2", 1, ndeNext, "Root 2")


Huh ?

It works with this project:

Form1.frm
HTree.cls
HNodes.cls
HNode.cls

But doesn't work with this

Form1.frm  (which is the same as the above form1.frm
with Ref. to DLL


Someone ?
Please !
Comment
Watch Question

Commented:
send the source (zipped) to aecornetto@sai2000.com and I'll take a look.  If you can't, show me what the function headers of your functions  are

Commented:
Try putting two project together one with the class files and the other with the test EXE (note do not put them into the same project, but rather into seperate project in the same group.)  Then try running the code and see what happens.

Commented:
If you send a copy of your test project and activeX DLL project to tom@ndimensional.com, I will also take a look at it. (zipped please)

Commented:
Make sure that you have not referenced a copy of the .dll file in the VB references section as that will take preference over any included project in a project group.  Seems odd but the references does take precedence for class modules over other project classes in the project group.
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.