Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Send Message from One PC to Another

Posted on 2001-06-08
11
235 Views
Last Modified: 2013-11-13
hello,
     
    i want to send a message from one PC to another PC
i am using VB 6.0 and Sql-server 7.0 in my project.
Using any api is it possible?
(and those api will work on Windows NT and windows98 both)
waiting for reply.

thankx
nisha
0
Comment
Question by:NishaSangani
11 Comments
 
LVL 3

Expert Comment

by:sridhar_PJ
ID: 6167567
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6167577
I don't think it is possible for Win98. It would be possible for Win NT or 2000 system. Below will work on NT and 2000.

Try this
http://www.freevbcode.com/ShowCode.Asp?ID=395

hongjun
0
 
LVL 3

Expert Comment

by:sridhar_PJ
ID: 6167589
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 3

Expert Comment

by:sridhar_PJ
ID: 6167595
sorry i pressed the Refresh Button, so my comment added twice
Sridhar
0
 

Expert Comment

by:rhubarbtwo
ID: 6167659
What about using DDE, you would need a client app on one PC and a server app on another? It would work on Win9x. Or what about using TCP\IP?
0
 
LVL 3

Expert Comment

by:jrspano
ID: 6167879
what kind of messages?  just to a user you could use netsend.  it pops up a window in the middle of their screen.  the syntax is something like net send cpuname or username "message" you could use shell in vb to send the message
0
 
LVL 4

Expert Comment

by:PBuck
ID: 6167892
Here at my work, we have taken time to redo our main app that everyone uses within the Division and so we added a few features - one is what we called our Port Listener.

Of course, this only works if the listening program is up and running.  But try downloading www.catalyst.com free control called SocketWrench.  This control makes it extremely easy to build this port listener (we use TCP - but we also have the switch ready to use UDP).

But it is one option on Win9x machines.  Works great!

Hope this helps some!
0
 
LVL 5

Expert Comment

by:dredge
ID: 6167971
use the Microsoft Winsock Control that comes with VB6 and create a TCP/IP connection. it's quite simple and supported on ALL versions of windows. (except 3.x - that one has to have a custom built tcp/ip interpreter)
0
 
LVL 14

Expert Comment

by:wsh2
ID: 6168061
<ping>
0
 

Author Comment

by:NishaSangani
ID: 6170932
hello again,

i am trying to work on PBuck suggession.
thankx
0
 
LVL 4

Accepted Solution

by:
PBuck earned 75 total points
ID: 6181700
I have included some code to help you out since you are trying this from scratch (I made our Port Listener as a ActiveX DLL - but will work fine otherwise).


Option Explicit
'----------------------------------------------------------'----------------------------------------------------------Private WithEvents TCPSocketWrite As SocketWrenchCtrl.Socket
Private WithEvents TCPSocketListen As SocketWrenchCtrl.Socket
'----------------------------------------------------------
'Import all the SocketWrench constants!

Public Sub InitWriteSocket()
On Error GoTo errWrite
   Set TCPSocketWrite = New SocketWrenchCtrl.Socket
   
   If TCPSocketWrite.Connected Then
      TCPSocketWrite.Shutdown = 1      'Close current Connections
   End If
     
'WRITER
   TCPSocketWrite.AddressFamily = AF_INET
   TCPSocketWrite.Binary = True
   TCPSocketWrite.Blocking = False
   TCPSocketWrite.BufferSize = 2024
   TCPSocketWrite.Timeout = 5000
   TCPSocketWrite.Protocol = mvarProtocol
   If mvarProtocol <> IPPROTO_UDP Then
      TCPSocketWrite.SocketType = SOCK_STREAM   'TCP/IP
   Else
      TCPSocketWrite.SocketType = SOCK_DGRAM    'UDP
   End If
   TCPSocketWrite.RemotePort = 0
   Exit Sub
   
errWrite:
   RaiseEvent Errors(Err.Description)
End Sub

Public Sub InitListenSocket()
On Error GoTo errListen
   Set TCPSocketListen = New SocketWrenchCtrl.Socket
   
   If TCPSocketListen.Connected Then
      TCPSocketListen.Shutdown = 1     'Close current Connections
   End If
   
   mvarMAC = TCPSocketListen.PhysicalAddress
     
'LISTENER
   TCPSocketListen.AddressFamily = AF_INET
   TCPSocketListen.Binary = True
   TCPSocketListen.Blocking = False
   
   If mvarProtocol <> IPPROTO_UDP Then
      TCPSocketListen.Timeout = 5000
      TCPSocketListen.HostAddress = INADDR_ANY
      TCPSocketListen.Protocol = mvarProtocol
      TCPSocketListen.SocketType = SOCK_STREAM  'TCP/IP
      TCPSocketListen.LocalService = "echo"
   Else
      TCPSocketListen.AutoResolve = False
      TCPSocketListen.Protocol = mvarProtocol
      TCPSocketListen.SocketType = SOCK_DGRAM   'UDP
   End If
   Exit Sub
   
errListen:
   RaiseEvent Errors(Err.Description)
End Sub

Public Sub ListenOnPort(PortNo As Long)
On Error GoTo errPort
   If PortNo > 0 Then
      mvarHostPortNo = PortNo
      InitListenSocket
      If mvarProtocol <> IPPROTO_UDP Then
         TCPSocketListen.LocalPort = PortNo
         TCPSocketListen.Listen
      Else
         TCPSocketListen.LocalPort = PortNo
         TCPSocketListen.RemotePort = PortNo
         TCPSocketListen.Open
         mvarListenConnected = True
      End If
   End If
   Exit Sub
   
errPort:
   RaiseEvent Errors(Err.Description)
End Sub

'This is just part of the DLL - it is not a large program at all, but I thought the above might help some  :-)
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

856 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