Board index » cppbuilder » Port sharing/splitting?
Zahir
![]() CBuilder Developer |
Zahir
![]() CBuilder Developer |
Port sharing/splitting?2006-05-12 11:46:46 PM cppbuilder106 hello! i am wondering if there is an API i can use to give my application access to a comport to which a printer is connected, i would like to archive the data going to the printer. |
Zahir
![]() CBuilder Developer |
2006-05-12 11:48:33 PM
Re:Port sharing/splitting?
hello,
i am looking for a freeware c++ bulder component that i can use to access data going to a printer (share/split the port) so that i can archive the data. Zahir |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2006-05-13 01:10:58 AM
Re:Port sharing/splitting?
"Zahir" < XXXX@XXXXX.COM >wrote in message
Quotei am wondering if there is an API i can use to give my application {smallsort} |
Bob Gonder
![]() CBuilder Developer |
2006-05-13 02:23:13 AM
Re:Port sharing/splitting?
Remy Lebeau (TeamB) wrote:
Quote"Zahir" wrote in message Quote>i would like to archive the data going to the printer ie. the man-in-the-middle or wire-tap models. Perhaps Zahir could clear that up? |
Boba
![]() CBuilder Developer |
2006-05-17 12:16:10 AM
Re:Port sharing/splitting?
"Zahir" < XXXX@XXXXX.COM >wrote in message
Quote
driver to back up the data. you may want to consider tapping into printer spool and just archive only spooled data. if you still need the binary data streamed through the port, then let me ask: what do you plan to do with it? |
Zahir
![]() CBuilder Developer |
2006-05-17 07:20:20 PM
Re:Port sharing/splitting?
Oops! sorry guys had problems with my internet link, i am back now...
I want to sort-of intercept the data going to the printer, archive it and let the printer also make a hard copy. i mean something like to be able to make my app read the port memory without interfearing with the application that sent this data. Why i need this? to save alarms from an old automation system that does not have an OPC server. Assist please. |
Bob Gonder
![]() CBuilder Developer |
2006-05-18 12:44:35 AM
Re:Port sharing/splitting?
Zahir wrote:
QuoteWhy i need this? to save alarms from an old automation system that does not have an OPC server. Assist please. Connect one of it's com ports to the automation system, and read the data on that port. Connect the other com port to the printer, and re-send the data to the printer, or to a network printer. |
Zahir
![]() CBuilder Developer |
2006-05-18 02:49:05 PM
Re:Port sharing/splitting?
Bob Gonder wrote:
QuoteLow-tech method.... |
Eric Noel
![]() CBuilder Developer |
2006-05-18 11:29:51 PM
Re:Port sharing/splitting?
Zahir wrote:
QuoteSure this should work. But as you put it, Low-tech method!...and since i have this feeling that it is possible to get this data from the com port buffer somehow....there should be another way out (i have seen some commercial port splitting softwares such as the one from Eltima) method is pretty much the same. Create a virtual port, log the data as it comes in, and then forward it on to the real port. Creating a virtual serial port is not trivial, so if this is a one-off job, I'd use the low tech method. You don't need another PC though, just hook up 2 usb serial port adapters (about $20 each), hook up a null modem cable from the original port to one of the new ports. Write a simple app to read from the new port, log, and forward off to the second new port. - Eric |
Jim Dodd
![]() CBuilder Developer |
2006-05-19 10:11:52 PM
Re:Port sharing/splitting?
Zahir wrote:
QuoteOops! sorry guys had problems with my internet link, i am back now... on serial and parallel ports. I don't know how to get it to give you the data but perhaps you can get them to tell you how they did it. Link to the utility: www.sysinternals.com/Utilities/Portmon.html Description: Portmon is a utility that monitors and displays all serial and parallel port activity on a system. It has advanced filtering and search capabilities that make it a powerful tool for exploring the way Windows works, seeing how applications use ports, or tracking down problems in system or application configurations. Portmon works on NT 4.0, Win2K, XP and Server 2003, Windows 95 and Windows 98. Regards, Jim Dodd Onset Computer Corp. |
Mike Collins
![]() CBuilder Developer |
2006-05-19 11:56:28 PM
Re:Port sharing/splitting?
There are many ways to achieve this depending on how complex or robust you
want to make it. If you are writing a system that needs to be deployed on many different systems then your best options is to write some sort of filter driver. However this is not a straightforward task and requires the MS DDK which is costly and complicated. Another option is to use DLL-injection and API hooking. If it is aimed at capturing one specific application then this shouldn't be a big deal. You need to determine how the legacy application is communicating with the com port and then inject into it's process space and hook the api that it uses. Once this is done, you hook / callback procedure will be called before the API in question, and it will give you the facility to achieve the data and reject or relay the call on to the real api. If you feel this is an option that you would like to pursue then post back with your e-mail address and i can contact you. I can provide you with some information and some starting points, although i can't actually provide you with source code as my injection system is based on another's that i have licensing for. As a starting point, look at www.codeproject.com and do a search for dll-injection and api hooking. HTH, Mike C "Jim Dodd" < XXXX@XXXXX.COM >wrote in message QuoteZahir wrote: |
Jim Dodd
![]() CBuilder Developer |
2006-05-21 05:20:51 AM
Re:Port sharing/splitting?
Mike Collins wrote:
QuoteThere are many ways to achieve this depending on how complex or robust you you up on your offer. Zahir, offers like Mike's don't come every day. I suggest you contact him. Jim |
Zahir
![]() CBuilder Developer |
2006-05-25 06:33:27 PM
Re:Port sharing/splitting? |
Zahir
![]() CBuilder Developer |
2006-05-25 06:37:06 PM
Re:Port sharing/splitting? |