Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Send Message from One PC to Another

Posted on 2001-06-08
11
Medium Priority
?
241 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
[X]
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
11 Comments
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 300 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

715 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