referencing mainfrm objects from a class
from form main i call a class that populates all the properties of a node.but to display the image of the node i need to add images from this class on to the image list control on form main. i will just show you the code snippets to make my point more clear.
from form main :
Set gPhysTree = New CPhysicalTree ' is a call made to class cphysical tree that will set all the properties for physical tree treeview.
> form main has an imagelist control iml tree that contains all the images that will be present in tree view nodes and has to be populated at run time.
>in cphysical tree class
when i try to implement this code.
For X = 1 To frmmain.imlTree.ListImages.Count'it causes error 426
If frmmain.imlTree.ListImages(X).Key = TypeName Then
Else
frmmain.imlTree.ListImages.Add , TypeName, Scodpic
End If
Next X
Set NewNode = .Nodes.Add(parentNode.Index, tvwChild, , _
Obj.Name & " [" & TypeName & "]", _
TypeName)
it throws an error no 426 that only one mdi form allowed.
since my main form will always be opened before this code is executed .
is there any method i can use to reference the frm main object (imagelist)from class module and populate it.

