Solved

Routine accessing com port & logging

Posted on 1998-10-23
5
208 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
Comment Utility
Edited text of question
0
 

Author Comment

by:thenovice
Comment Utility
Edited text of question
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Today companies are subjected to more-and-more data, and it won't stop any time soon.  But there are obvious opportunities for reducing data, particularly data duplicated among companies.
A high-level exploration of how our ever-increasing access to information has changed the way we do our jobs.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

771 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

8 Experts available now in Live!

Get 1:1 Help Now