Solved

Send Message from One PC to Another

Posted on 2001-06-08
11
232 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
Comment Utility
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
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
Comment Utility
0
 
LVL 3

Expert Comment

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

Expert Comment

by:rhubarbtwo
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 3

Expert Comment

by:jrspano
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
<ping>
0
 

Author Comment

by:NishaSangani
Comment Utility
hello again,

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

Accepted Solution

by:
PBuck earned 75 total points
Comment Utility
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

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

Join & Write a Comment

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

772 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

15 Experts available now in Live!

Get 1:1 Help Now