I'm creating a project but I only need exe's as my final thing. I don't know how to put it in simple terms, but here is how I need it to be..
The main window remains open i.e. frmMain. ther other forms are only called by an external program (LanSafe UPS Software) every time something happens (Either batteries gets disconnected or power fails). Each of these forms have to be separate executable files. This application is for sending SMSs using Fusion 100 modem. Is what I need possible? If yes, how? Please help..
You could certainly create a different exe for each form, but that is almost certainly not the best way to go about it. From your description, it sounds like the program will be running, with the main form open. When the external program announces something, then you want other forms displayed. If that is the case, it would be easier with one exe that intercepts the notices from the external program and displays whatever form is needed at that time.
The main form form is just for displaying the status. When the other forms are called, they don't really have to be displayed, but each form sends a different SMS and closes. It is the external program that controls these exe's and every time a different event occurs, a different exe is called, and the frmMain dispalys the status.
Still why use different exes? You can have the SMS message saved in various constants that will be called to send based the same way you would call each form (or your various exes).
The external program, LanSafe to be presice, calls only exe's, and I don't know any other way of achieving what I want. If there's, please tell me.
May be to add, i'm not good at VB as i have never gone to class to learn it. Here, vbforums has always been my class and you, my lecturers. The litttle I know is from you. So I appreciate everything you do here..
I'm not familiar with LanSafe. When you mentioned the modem, I got a bit sidetracked. I thought that LanSafe might send out messages, but you do clearly state that you want to use the modem for sending the SMS messages.
So with LanSafe, you can tell it programs to run when certain things happen? That sounds really weird. I would be surprised if that was the only way they are willing to communicate, as that would be about the worst way possible these days. Still, if it doesn't send out messages via TCP or UDP, or something like that, then perhaps the exe is the only way. I'd certainly be taking a second look to be sure that LanSafe doesn't emit anything else.
However, if LanSafe only wants to call exes, then that's life. If that is the case, I would say that your project should be split into several projects, but it doesn't sound like there is any point in having forms in those projects. If they don't have to display anything, then don't bother with forms. An unnecessary form would just burden down the operation for no gain. Look into a console app, or even a service, as simpler programs that would fit your needs. It also sounds like you would want these apps to communicate with your main form. If that's the case, then you have several options: TCP, UDP, WCF named pipes, and so on. Any of those would work, with the greatest number of examples being for TCP, the easiest being UDP (though it has a few issues to be aware of), and WCF named pipes might be the fastest.
Thanks alot. let me look into one of these. But just to mention, LanSafe doesnt send SMS or email without internet connection. Here we are looking at a computer without an internet connection, thats where the Fusion 100 GSM Modem comes in.
I have seen other apps like this (my app does a similar thing as it happens), monitoring hardware with tools that have "other" methods to "customise" their application. It is more like a tick in a box that actually useful, and most of these tools just run a command. One thing I would suggest you could do however is this (from their website)
Logs UPS events into Windows’ own event log
In addition to logging information into its own logs, LanSafe logs all the event changes also to the Windows standard Event Viewer log.
Email Alerts
mobile phone regarding power problems.
Network broadcast Alerts
UPS event change notifications can be broadcasted over the network to designated users.
You can create an app that monitors the event log and just watch for those events. You can watch a mailbox. You can watch for these notifications (it does not say what they are, however snmp and syslog are quite common I have found).
Edit: Yer, it can send out SNMP traps.
Last edited by Grimfort; Oct 20th, 2011 at 03:10 PM.
If it does Network broadcast Alerts, that is probably UDP broadcasts. That would be excellent. TCP would also be possible, since they mention 'designated users'. Either one would be good to consume.