Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sharing Variables / Data between VB applications on LAN 3

Status
Not open for further replies.

kcoder9

Programmer
Aug 25, 2003
13
IN
Hello All,

I have written a VB application running on one PC which receives data from an external device on COM Port and displays it. Now, I need to be able to access the current data / strings (which is continually being updated) from other PCs on LAN.

The need is to have a direct transfer of data between VB applications on different PCs on LAN without using Excel, Access or Text Files etc.

Can someone please help? Thanks!

Kcoder9
 

Have them send you their data via the com port. You will probably need to set some kind of signal in the bytes that are passed if these other strings are not to be displayed so that you can tell the difference between the two.

Good Luck

 
Thanks vb5prgrmr for the prompt reply. However, i feel i could not convey my real problem properly.

The problem is not of distinguishing between various data or strings. Actually i need to know how to access data (integer, string or any other type) available in a vb application on one PC from vb applications running on other PCs on LAN.

As the data value in the originating application is changing continuously, a method which involves sharing of data through files (originator writing to a text or database file and others on LAN reading from this file) does not seem efficient.

Is there any method available (something like DDE) using which many users on LAN will be able to read the continuously changing data values in the originating application and display these changing values.

Any help on this subject will be much appreciated. Thanks!

kcoder9
 

Ok, it sounds like you want to do a pull architecture or a polling scheme. Meaning ...

You want to have a server like component doing some work on some machine and if a user is interested in the work that it is doing they start a local display application that connects to this component, and based upon a timer (of some sorts) on the local users machine the display app asks the server app for its info. The server app then responds with the info and the child or users app displays it.

DCOM/COM is one way to go and there are others like the com-port idea that you are already using, BUT to share memory between PC's I do not think it is possible, nor would it be wise, let alone the problems you have trying to share memory between two applications on the same machine without making either of the applications crash or the OS.

Good Luck

 
Thanks again vb5prgrmr for the prompt reply. You got me right!

I need to create a server like component and a local display application that connects to this component to be able to display the info available in the server app. Many instances of the local display app could be running on different PC's on LAN and asking for same info from server app which will respond to all the requesting apps with same data.

I have not worked on DCOM/COM before. Where can i find a good primer on this subject? can i get a code example of the kind of query-response arrangement that i need to create between the server app and the local display app?

Please help me! Thanks in advance.

kcoder9
 

Search the web, search this site, got any books? You will be able to find information on COM and DCOM just about anywhere.

a search of yahoo for "tutorial com dcom visual basic" returned "TOP 20 WEB RESULTS out of about 13,900"

or you can try google

There are a couple of other search sites that you can try but you will run across them in either of your yahoo or google searches.

Good Luck

 
You could also try broadcasting across a winsock connection. Have each app listening on the same port, and each time the data or variables change, call a procedure to broadcast these values to other pc running the software.

BB
 
As BiggerBrother mentioned, winsock is one option (as is DCOM, as mentioned by vb5prgrmr). Two other options are Named Pipes and Mailslots
 
Thanks vb5prgrmr, BiggerBrother and strongm for showing me the directions. A star to each of you for now.

Quite a few options out there. Now my problem is to figure out which is the best option for the job on hand. More stars when i am able to understand which was the most relevant reply.

i have searched the web and this site as well and found a lot of info. Thanks again to all three of you for extending me the help.

kcoder9
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top