Solved

How to send message and print-out to another computer ?

Posted on 2002-06-07
11
181 Views
Last Modified: 2013-11-13
I need someone to share with me the source or programming knowledge to develope a small application which will enable an user to send a message to a group of computer with a pop-up windows and print out the message to a printer accross the network.
0
Comment
Question by:netcool
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 7061496
http://www.freevbcode.com/ShowCode.ASP?ID=137

Is a sample that shows how to use winsock to create a chat application that allows you to send messages to other computers.
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7061538
how abt "Net Send" in your application. And for the printing, do you want your individual users to take a print out or a general print command after the message has been sent to all the users

-priya
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7063862
As long as i know, Net send shows a message box, how do you print it?
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7063988
yes you are right Richie_Simonetti, Net send only sends messages to different pc. What i was thinking is maybe the application which sends the Net send can also write to a file or a vb form and take the print out of that file or the form, something like that.

How abt if one creates a client-server application. That is the client will initiate a request to a port on the  server program which listens to some requests on different pc. If it receives it will show a form to the client pc, then maybe that person can have a customised form, which will ask him if he wants to print the form or not.

This is just a logic i was thinking, maybe there is a better way to do it.

-priya


0
 
LVL 5

Author Comment

by:netcool
ID: 7066014
Priya,what you said is what i need. Sort of client server application but i need it as simple as possible. This is a program is like emergency system which will alert the user of the building of any alarm or activity going on.
I also need user to acknowledge the message.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7067144
Simple client-server app:
http://www.vb-world.com/demos/winsock/
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7067182
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7069787
This is just a test appln code: I think you can start of with this and see how you can incorporate in your project applications:

->Project1(This is your server appln project)
Put a winsock control on yr form
-----------------------------------------------------
Private Sub Form_Load()
serverConnect
End Sub

Private Sub serverConnect()
Winsock1.LocalPort = "1114" 'any port between 0-8000 (i think. check this out)
'waiting for client's request
Winsock1.Listen

'ErrorHandler:
'MsgBox ("Port is already in use. Please close any other program using the same port....")
'End
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckClosed Then Winsock1.Close
   ' Accept the request with the requestID  parameter.
 Winsock1.Accept requestID
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Winsock1.GetData strData


If InStr(strData, "online") >= 1 Then
        Shell "\\...yourexePath.exe", vbNormalFocus
        MsgBox "hello"
End If
'if client request is not specified string then give message
    If Error = False Then
        MsgBox ("Unknown Parameter : '" & strData & "'")
    End If
End Sub


------------------Project1 (serverprogram ends)------------


'**

Project2(client program)(Put a winsock control on this form also)
-----------------------------------------------------------
Private Sub Command1_Click()
Winsock1.Connect "200.200.15.17", 1114
'where 200.200.15.17 'is yr IP address and 1114 is the port where the server is listening and yr msg is being send
End Sub

Private Sub Winsock1_Connect()
Winsock1.SendData ("online")
End Sub

Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
MsgBox Description
End Sub

Private Sub Winsock1_SendComplete()
Winsock1.Close
End
End Sub

--------------------Project2 ends--------------

How to go abt it...

In the server program:
Put a breakpoint at "serverConnect" , Winsock1_ConnectionRequest and Winsock1_DataArrival

In the client program (project2) put a breakpoint at Winsock1.SendData ("online")

Run the server program(F5) first and then start the client program. Try doing thru F8. It will give you an idea how the whole thing works.

This is just a test appn i wrote. In the shell event you can call your form by checking the paramters, whatever you want.

Hope this helps you.

-priya

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7069883
:O, so similar!
0
 
LVL 5

Author Comment

by:netcool
ID: 7071720
All of your ANSWERs are very good and it work for me.Thanks.BUt, i will give the point to the first person who answer the question correct.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7123289
One thing is helping for free and other is working for free.
Cheers
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now