Example “Counting”:
This example shows how one VB program, called HANS, creates a variable with the name “EdelweissFound” and constantly increments it using a timer. A second VB program, called KARL, creates the same variable. Using the ‘WithEvents’ statement KARL installs an event handler for the variable. This allows KARL to be notified whenever the value of the variable changes. Every time HANS increments the “EdelweissFound” variable, KARL’s MyCounter_Changed() event handler is executed and the value of the “EdelweissFound” variable is displayed.
Program HANS:
Dim MyCounter As beWISE.var_INTEGER
Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load MyCounter = Create.New_var_INTEGER("EdelweissFound") End Sub
Private Sub Increment_Tick(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Increment.Tick MyCounter.Value = MyCounter.Value + 1 End Sub
Program KARL:
Dim WithEvents MyCounter As beWISE.var_INTEGER
Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load MyCounter = Create.New_var_INTEGER("EdelweissFound") End Sub
Private Sub MyCounter_Changed() Handles MyCounter.Changed EdelwiseLabel.Text = Format(MyCounter.Value, "#####0") End Sub
HANS can talk to all of KARL’s twin brothers at the same time. I.e. you can start KARL.exe as many times as you want. Each instance will receive its separate ‘Changed’ event and display the correct “EdelweissFound” counter. |
www.edelwise.com |
This product allows you to share 1 (one) variable of type INTEGER among your VB.NET programs. If you just want to synchronize different VB.NET applications during runtime, then this is all you need. |
Product Summary |
FREE |
Other useful links: product FAQ product comparison chart product licensing |
The Essential Resource for Visual Basic Developers |
Home | beWISE Features | VB6 Products | VB.NET Products | Tools | FAQ | Project List | User Forum | Legal | About Us |