For winsock you can normally just pick a fixed port number >= 0xC000 for the
server and the client calls that number. Why would prior knowledge of a
a fixed port) asking the server to tell you what port to use for TCP/IP. The
BOOTP protocol and DHCP do something like this.
Your comment about multi-threading is confusing and not relevant. You can
handle multiple sockets in one thread, even in a GUI thread. (They have to
be in nonblocking mode).
window WNDCLASS::lpszClassName. You can then send a message to a particular
SendMessage to the returned HWND. If FindWindow returns NULL then the app
is not running.
I thought about winsock, but the problem is knowing which ports are
available to listen and establish a connection. If I used winsock throught
he loopback, is there a way for two apps to communicate with knowledge of
port number. I.E. I don't have the ability to multi-thread in the
development environment, but need the ability to establish a connection and
without prior knowledge of the port. Is this even possible.
The sendmessage with WM_COPYDATA sounds good, but how can I tell if my
application is running for which I send the message from the client. I.E.
Which DDE if a connection is not establish, then most like the server
application is not loaded, so I can lauch it then establish the link to
send the data, but how can we do the same while using WM_COPYDATA.
Thanks,
James
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:uMT5uKglJHA.3876@TK2MSFTNGP02.phx.gbl...
"James Williams" <Jim_L_Williams@hotmail.com> wrote in message
news:u$WUq7flJHA.2064@TK2MSFTNGP05.phx.gbl...
Hello,
I am in needof the ability to implement DDE, but the SDK says that this
is now depreciated and to use OLE instead. First, Can ole be used
without the application and server having to make registry changes.
Also, I don't what to require that the application be installed.
Actually what I want to do is use messaging inside of an application
from another application. I.E external process messaging, but the only
thing that is support is DDE by one of the applications.
What is the suggested path to replace DDE servers and clients?
OLE (now called COM) needs registry changes and it needs to be installed
(to create the registry changes!). It also takes months of pain to
learn.
There are several other ways to do interprocess communication. The
absolute easiest is SendMessage with WM_COPYDATA. It copies a block of
data to the destination application. No registry, no install.
Another option is to use winsock via the on-machine loopback address.
This has the additional feature that it can work between machines.
--
Scott McPhillips [VC++ MVP]