Solved

Routine accessing com port & logging

Posted on 1998-10-23
5
213 Views
Last Modified: 2013-11-15
I am VERY new to C++, but I have had a request to design a program, and I
think it is beyond me.

"A project with a no timetable is starting and now (in the beginning) at the
design time, is the best time to involve you
1)  I need a routine that will open a windows Comm port,
read that data entering through it then pass it to a windows handler.

2) Using a Windows Message to tickle a list of users logged into the
(in-house) Server cause the Node to activate a local(node station) program
bringing a (current window) that is hidden, up-front and in your face.
Maybe even play a WAV file to-boot."

Do you have any suggestion on books or examples that may be helpful. ANYTHING would be much appreciated. I not sure if I should even attempt this at my level, but I am itching to try!

Thank you for you input.
P.S. What is the basic difference (in learning and appllying) between C++ & VC++?
Bob
0
Comment
Question by:thenovice
5 Comments
 

Author Comment

by:thenovice
ID: 1175910
Edited text of question
0
 

Author Comment

by:thenovice
ID: 1175911
Edited text of question
0
 
LVL 22

Expert Comment

by:nietod
ID: 1175912
The windows API CreateFile() can be used to open the COM port.  Then you can use ReadFile() to read from it.

I don't know how to communicate with other workstations on a network.  so i can't help you with the 2nd part.

 What is the basic difference (in learning and appllying) between C++ & VC++?
VC++ is not a language or anything.  It is a C++ compiler.  I compiles ordinary C++ programs.  I has a GUI user interface that allows you create parts of the program quickly.  Like a class wizzard that can start a class for you, but you still need to write the real C++ code.  It has a class viewer that looks at your C++ code and shows you your classes graphically.  But it still is just a C++  compiler and some tools for making working in C++ easier--but it is still 100% C++.
0
 

Expert Comment

by:lestat007
ID: 1175913
The following suggestion assumes you are using a windows 95/NT environment on both the client and server.

You say that users are going to log into this server via a serial port.  If you're going to be doing any type of client/server application you should use a socket instead of just a serial port.  The reason why is that if these clients and server machines are going to be in close proximity, then you should be using an Ethernet card instead of a serial port.  That way you could simply open an asynchronous socket to the client.

On the other hand, if your client and server are not in close proximity (now or in the future) and you have to communicate through the serial port over a modem, you might as well use the Internet.  That way you could still use the same asynchronous socket code mentioned above.  Of course, in order to access the Internet you'll need an ISP.

Check out the MFC class CAsyncSocket.

The reason why I say this is that the days of direct low level serial port communications is dead.  No one uses it directly any more.

I suggest you do it the right way and open a socket.  It's a lot easier than opening the serial port.
0
 

Accepted Solution

by:
Mathy120398 earned 50 total points
ID: 1175914
I would suggest looking into purchasing a serial communications library.  I have used one made by Greenleaf Software called CommLib.  It is compatible with all kinds of C/C++ compilers and all kinds of operating systems.  Check it out.  Their web site is www.greenleafsoftware.com.  Hope this helps.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 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

21 Experts available now in Live!

Get 1:1 Help Now