Hi
I have an interface that I have put in a separate dll.
I implement this interface in a user control ocx.
In my main program, i have the dll and ocx referenced,
and I load the user control depending on which form is showing.
I use this code to do it:
VB Code:
Private Sub Form_Load() Dim oCtl As Object Dim ctlMain As FormControls.ctlBuy Dim clsMain As FormClasses.clsForm Set oCtl = Controls.Add("FormControls.ctlBuy","ctlCur") Set ctlMain = oCtl ' I set the control's properties and show it here... Set clsMain = ctlMain End Sub
This works fine until the statement 'Set clsMain = ctlMain'.
This gives a type mismatch error.
The dll is compiled with binary compability, and was compiled
before I started making my user control. I have checked that
it is the same dll that is referenced both from the main app and
from the ocx project.
What am I doing wrong here?
