Hi Mark,
The execution does not go inside the CopyPropertis method because the
error is in that line of code itself. The type mismatch error can
be caused by, well, trying to use a wrong object, or if you are
using a not initialized object. Are you sure that both fi(iA) and
fi(iA+1) are not Nothing?
Regarding typename and name overload, usually when I declare an
object I use the full name (library.object) so I am sure that the
compiler and I agree on the type of object, at least... like
dim cObj as MyProject.MyClass
Dim mItem As MSComctlLib.ListItem
And be careful that both Typename and Typeof work even though
the object you are testing is nothing.
Marco
>
I'll explain my real problem, which I was investigating with TypeOf:
I have a usercontrol named FormItem. I am calling a method on an instance
of
that usercontrol while passing to it another instance of the usercontrol.
Both instances of the usercontrol are members of a control array, hence the
code is:
fi(iA).CopyProperties fi(iA + 1)
This is raising a type mis-match error in VB. Now something more disturbing
is occurring in the project which is that I cannot step into the
CopyProperties method even though the usercontrol is in the same project!