I've an exe that creates an object with reflection using Createinstance. All
ok.
Then I call method in this object, that returns a user-defined control. This
code is executed.
I've very strange problem in the user-defined control constructor. Some code
is executed. This calls mybase.new, initializecomponent, and sets some
property on contained panels. Then the constructor calls an internal sub
(public or private is the same, I've tried either). This sub may create some
other objects, but this is not the problem. The problem is that when I call
the sub from the constructor, I get this strange error:
Method not found: Void
MyNameSpace.PanelPreview..ctor(MyNameSpace.Display Area, Byte).
The sub I'm trying to call is
Private Sub BindPageToPreview(ByVal page As DisplayPage)
The constructor is:
Public Sub New(ByRef display As myobjecttype)
MyBase.New(DirectCast(display, DisplayHardwareDevice))
InitializeComponent()
' please note that this panelPreview is not a normal windows panel, not
a panelpreview type object. Is it created yb designer, so it is instantiated
by initializecomponent
panelPreview.Width = CPU.Width * _scaleFactor
panelPreview.Height = (CPU.Height + display.Page(0).Area(0).Height) *
_scaleFactor
BindPageToPreview(display.Page(0))
End Sub
The sub is defined in the same -vb file as
Private Sub BindPageToPreview(ByVal page As DisplayPage)
[cut]
end sub
This same code, if called by a simple test program, works well.
What can I do?
thanks