The DNN mod dev guide gives a basic explaination, but not how to implement it. To test it create two modules - Isend and Ireceive. Isend doesn't need any controls. Ireceive needs a label. Here's the codebehind:
Public Class Isend
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
Implements DotNetNuke.Entities.Modules.Communications.IModuleCommunicator
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim args As New DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs
args.Sender = "Isend"
args.Target = "Ireceive"
args.Type = "Action"
args.Text = "LoadMessage"
args.Value = "Message loaded through IMC"
RaiseEvent ModuleCommunication(Me, args)
End Sub
Public Event ModuleCommunication(ByVal sender As Object, ByVal e As DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs) Implements DotNetNuke.Entities.Modules.Communications.IModuleCommunicator.ModuleCommunication
End Class
Public Class Ireceive
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
Implements DotNetNuke.Entities.Modules.Communications.IModuleListener
Protected WithEvents lblMsg As System.Web.UI.WebControls.Label
Public Sub OnModuleCommunication(ByVal s As Object, ByVal e As DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs) Implements DotNetNuke.Entities.Modules.Communications.IModuleListener.OnModuleCommunication
If e.Sender = "Isend" AndAlso e.Target = "Ireceive" Then
Select Case e.Type
Case "Action"
Select Case e.Text
Case "LoadMessage"
Me.lblMsg.Text = e.Value.ToString
End Select
Case "log" ' or whatever
End Select
End If
End Sub
End Class
This code is not tested, but should be close to getting you started.