. . . . . I know there's a way to let two VB applications communicate with each other. I would like to find out how to have an interface where one application sends text commands to another application (not online, on the same machine) so that the receiving application can interpret those commands and act accordingly.
. . . . . A little background: I run an online game called 'Dragon's Era'. It's a wonderfully large game I've been programming for the past two years of my life like a part-time job. The server can cramp up at times and it's usually very laggy. The command structure I have installed in the server is subject to that same lag, so when I need to execute a series of commands quickly I cannot do it.
. . . . . If I can build a seperate application which interfaces with the server on the same machine I could move my entire server control panel to that application and operate the server without any lag. The only real lag would be the delay in processing the text commands rather than a delay in operating and entering the commands. This would be very helpful for me.
. . . . . I've been searching for a way to do this. Could anyone tell me the basics or at least give me the correct topic to look under? I have heard Active X would be useful, but I'm not sure how to use it for that specific function. I appreciate any help. Thanks,
. . . . . Well, all I need is a simple interface which would send text commands one-way. I have only the server which runs from the compiler as it's still in Beta and under heavy developement. I haven't create the control application.
. . . . . Would I create the control application as an ActiveX control or would it be a seperate application with a custom-made ActiveX control used as the interface? If you can't already tell I've never programmed with ActiveX before.
Create a pipe between the two programs, and you can send data streams between them. (buy yourself a copy of Dan Applemans Guide to the Win32 API, best book ever made for VB).
Or you could add an IP server and port to the app and controller and control it via IP.
One way I have implemented string data transfer between process is attached.
Both the Client App and the Server App register a common "WM_MyControlAPP" message and a pointer to a string variable's memory pointer is passed as the LPARAM to a SendMessage call from the Client APP.
The Server APP receives the Message, opens the process of the Client APP and reads the process's memory at the recieved LPARAM pointer.
One advantage is that since only the pointer is passed, any object or data type can be read from the Client's memory space by the Server.
"Brothers, you asked for it."
...Francisco Domingo Carlos Andres Sebastian D'Anconia
Felt Bored. Made this up (If you have not already done something like this). Any number of strings can be sent now between apps with only one Message registered.
"Brothers, you asked for it."
...Francisco Domingo Carlos Andres Sebastian D'Anconia
Thanks again! I'll use this to work on my server. Using this method is a LOT more secure than sending data through UDP or TCP/IP, although I would have used the latter if I had not know of this.
. . . . . Those applications are great and I've begun making the change, but I've realized that I'll need a source of data from the server provided to the client.
. . . . . It's a list of players currently playing, and it's contained within a listbox on the server. Rather than setting up a two-way memory transfer, could it be done by somehow periodically copying the contents of the listbox on the server to a listbox on the command module? I need a visual aid to tell me which player I'm trying to operate with, and jumping between two maximized screens with the server lagged down to a couple seconds per refresh isn't feasible.
. . . . . Is there a way to 'share' the listbox on the server with a listbox in another application, or to copy the contents periodically?
Yes. But subclassing or hooking an external Process/Thread is not advisable in VB. Memory crashes are very likely. I suggest you use the same method to pass the ListBox's values to the Client App.
"Brothers, you asked for it."
...Francisco Domingo Carlos Andres Sebastian D'Anconia
. . . . . Alright, thanks. I'm glad you told me about that...I wish someone had told me about how the winsock control leaked memory about a year ago or perhaps even before I started using it. It would have saved me about 200 crashes.