Hi,
The best source code that you can find to help you to develop your "virtual
serial comm port driver" is the source code for the serial driver from the
ddk 4.0 or w2k. It is the source code from which I have based my own
development for a similar virtual serial driver for NT and w2k that we use
internally.
Here are the steps that I have followed :
1. I removed all the code handling the hardware (in fact, I kept only the
code handling the win32 API).
2. I wrote some code which reads from the registry the loopback settings
(com4-com1) etc..
3. I wrote the code that send bytes, modem signals etc.. from one port to
the other.
4. I wrote a small application that configures the driver (creates a new com
port, indicates which com ports will be looped back together etc..).
Be carefull, it is not as easy as it seems because the win32 serial api is
quite complex (lots of call to supports). There's lots of tests to do to be
sure that the virtual serial port will work with different applications.
They all use different APIs and in many different ways.
good luck
Frederic Gauthier
Remove _NO_SPAM from the E-mai address
Quote:
> I have seen several post in regards to these questions but no answers.
> Hopefully someone can point me in the right direction after the have
solved
> the problem.
> I have two application that need similar functionality. These final
> applications will public domain so I rather not purchase a driver, but any
> ideas welcomed.
> First I need to create a virtual serial comm port (COMx) to
receive/transmit
> data from another app. Does anyone have sample code that can show me how
to
> create such a serial driver?
> The second is on the same idea, but it needs to modify the data stream
> going to a serial port. It could use a virtual port and then sent it to a
> physical port. I would rather have a "shim" that would intercept the data
> from a physical serial port COM1, modify the data and resend to the same
> port. My first phase of this application is one-way, transmitting from
the
> PC.
> Thanks
> Philip Kubat