VB6 to VB.net references in modules

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Back in 2011 I asked this question:
Converting one of my applications to vb.net from vb6. and in the application I have 2 different forms accessing a routine in a module like this..

Public Sub EndMMTTY(Hostform As Form)
On Error GoTo Err
Call Hostform.XMMR.PostMmttyMessage(RXM_EXIT, 0)
Hostform.MMTTYLoaded = 0
Exit Sub
Err:
MsgBox Err.Description, vbOKOnly
End Sub

in .net I keep getting error messages saying XMMR is not a part of the system.windows.forms.form . I get the same error message at the .MMTTYLoaded.

Is there a way I can do this in vb.net.. I have a lot of subs and functions that use the Hostform As Form and didnt want to add all of these into the individual forms..

After posting that I had decided to stick with vb6 so I didnt really need an answer.
But now a few years later and I really do need to convert this to vb.net
Now in the routine above the .XMMR is a ActiveX control that is located on both form1 and form2
MMTTYLoaded is a public variable that is located in both form1 and form2 so they hold different values.
I have the above routine in a module and was being access by either form by sending the Me variable when calling this routine. My question now is pretty much the same. How would I go about using this same routine in a module in vb.net?
I have other routines that use this same type setup passing the form into the routine that now do not work either so I need to find a way around it.

View the full article
 
Back
Top