Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Types of things


Message #1 by "Mark Roworth" <mark.roworth@b...> on Tue, 18 Feb 2003 16:29:24 -0000
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!


  Return to Index