Solved

Routine accessing com port & logging

Posted on 1998-10-23
5
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

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…
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

733 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