This project is read-only.

Multiple Forms

Feb 26, 2009 at 2:20 PM

Is is possible to have more than one form reciving the "NewGPSFix" event?

It would make the application im making now alot more flexible than having 1 form saving all the positions and then let the others get the info from it.

Mar 1, 2009 at 3:46 AM
Only one thread can open up the serial port, so technically no you cant have multiple instances of the handler running. However you could create a service that runs the handler, and connect to that service.
May 19, 2009 at 12:28 PM

And how could we do that? 

I mean, I imagine the service launches  GPS = new GPSHandler(this); and     GPS.Start("COM1", 9600); //Open serial port 

and, on the other hand, the Winform would launch:  GPS.NewGPSFix += new GPSHandler.NewGPSFixHandler(this.GPSEventHandler);

So the GPSEventHandler is located in the form, and the GPSHandler in the service. Is this correct? Or is it everything located in the service and the form just get the data?

As you can see, I'm a mess right now. Thank you.