Click here to Skip to main content
15,915,702 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to include a Collection Editor in custom UserControl (Component) Pin
Vikyjain14-Oct-04 22:28
Vikyjain14-Oct-04 22:28 
QuestionHow to Get Controls in Desigener window on to your own UserControl (Component) Pin
Vikyjain14-Oct-04 22:24
Vikyjain14-Oct-04 22:24 
GeneralVisual Basic 6.0 Backup Procedure 0:08 15 Oct '04 Pin
kengharng14-Oct-04 20:43
kengharng14-Oct-04 20:43 
GeneralRe: Visual Basic 6.0 Backup Procedure 0:08 15 Oct '04 Pin
Dave Kreskowiak15-Oct-04 1:39
mveDave Kreskowiak15-Oct-04 1:39 
GeneralRe: Visual Basic 6.0 Backup Procedure 0:08 15 Oct '04 Pin
kengharng19-Oct-04 19:13
kengharng19-Oct-04 19:13 
GeneralRe: Visual Basic 6.0 Backup Procedure 0:08 15 Oct '04 Pin
Dave Kreskowiak20-Oct-04 1:35
mveDave Kreskowiak20-Oct-04 1:35 
GeneralClick custom addin button Office Com Addin Pin
shinay14-Oct-04 17:26
shinay14-Oct-04 17:26 
GeneralRemoting / Windows Service / NotifyIcon communication. Pin
bswiftly14-Oct-04 9:01
bswiftly14-Oct-04 9:01 
I have looked through various tutorials and figured out how to get one of them working.. made a little sample with the following setup:

1) Server (console app, with console.readline() to keep the listener open)
2) Client (console app that calls the remote code)
3) Class library which is the remote vb.net code.


What I don't understand is how am I going to use Remoting to send a signal from my Windows Service to the system tray icon..(Windows form) ? When the Service becomes active I want it to send a message to the desktop (System Tray) so that the System Tray can change its icon into an 'active' mode, or I will have alittle msn like window pop up.

What I know: put the server code in the system tray project, client code in the Service.

What I need to know: When the Client calls the Remote Code, how can I get this code (which is just a class library) to pop up a window or do something as mentioned above? I couldn't get the remote code to work any other way than just a class library, is there a way to have my entire form the remote code? (I tried that but then couldn't reference it in the server because i can only reference .dll , and the .exe wasn't a proper format I guess).

Any help would be appreciated. Thanks.



This is the code:


Class library ###########################################
Public Class SampleRemoter : Inherits MarshalByRefObject

Public Function getUser() As String
Return Environment.MachineName
End Function

End Class
###################################################

Server###############################################

Class RemotingServer

Shared Sub Main(ByVal args() As String)

Console.WriteLine("Registering our remote object...")
RemotingConfiguration.RegisterWellKnownServiceType(GetType(SampleRemoter), "SampleRemoter", WellKnownObjectMode.SingleCall)
Console.WriteLine("Create and register a channel...")
Dim ch As New TcpServerChannel(8080)
ChannelServices.RegisterChannel(ch)
Console.Read()

End Sub

End Class

###################################################

Client ###############################################

Shared Sub Main(ByVal args() As String)
Try
Console.WriteLine("Registering Channel...")
Dim ch As New TcpClientChannel
ChannelServices.RegisterChannel(ch)
Console.WriteLine("Registering remote object in local domain...")
RemotingConfiguration.RegisterWellKnownClientType(GetType(SampleRemoter), "tcp://localhost:8080/SampleRemoter")
Console.WriteLine(" Create remote object and execute method")
Dim sr As New SampleRemoter
Dim username As String = sr.getUser()
Console.WriteLine("Machine name of remote machine = " & username)
Catch ex As Exception
Console.WriteLine(ex.ToString())
Finally
Console.Read()
End Try


###################################################

GeneralTraversing a form/frame's controls through code Pin
Pualee14-Oct-04 8:09
Pualee14-Oct-04 8:09 
GeneralRe: Traversing a form/frame's controls through code Pin
Dave Kreskowiak15-Oct-04 3:30
mveDave Kreskowiak15-Oct-04 3:30 
GeneralRe: Traversing a form/frame's controls through code Pin
Pualee15-Oct-04 17:27
Pualee15-Oct-04 17:27 
GeneralBinding Controls to a Class's property Pin
Maco de Vries14-Oct-04 4:30
Maco de Vries14-Oct-04 4:30 
GeneralLocating Folder regardless of OS Pin
cwayman14-Oct-04 3:33
cwayman14-Oct-04 3:33 
GeneralRe: Locating Folder regardless of OS Pin
Jim Matthews14-Oct-04 4:39
Jim Matthews14-Oct-04 4:39 
GeneralRe: Locating Folder regardless of OS Pin
cwayman14-Oct-04 4:58
cwayman14-Oct-04 4:58 
Generale-mail Crystal Report through VB.net Pin
Prakash Chajer14-Oct-04 0:00
Prakash Chajer14-Oct-04 0:00 
QuestionHow to detect if windows appearance is XP style or classic? Pin
Mr_Wilber13-Oct-04 23:45
Mr_Wilber13-Oct-04 23:45 
AnswerRe: How to detect if windows appearance is XP style or classic? Pin
Mekong River14-Oct-04 17:13
Mekong River14-Oct-04 17:13 
GeneralProblems with Crystal Report Pin
Mike Jo13-Oct-04 22:40
Mike Jo13-Oct-04 22:40 
QuestionHow to 'deploy' without need to install .net framework?? Pin
bitpusher13-Oct-04 13:26
bitpusher13-Oct-04 13:26 
AnswerRe: How to 'deploy' without need to install .net framework?? Pin
Colin Angus Mackay13-Oct-04 13:34
Colin Angus Mackay13-Oct-04 13:34 
GeneralRe: How to 'deploy' without need to install .net framework?? Pin
bitpusher13-Oct-04 13:48
bitpusher13-Oct-04 13:48 
GeneralRe: How to 'deploy' without need to install .net framework?? Pin
Colin Angus Mackay13-Oct-04 13:55
Colin Angus Mackay13-Oct-04 13:55 
GeneralRe: How to 'deploy' without need to install .net framework?? Pin
J4amieC14-Oct-04 0:50
J4amieC14-Oct-04 0:50 
GeneralRe: How to 'deploy' without need to install .net framework?? Pin
bitpusher14-Oct-04 5:24
bitpusher14-Oct-04 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.