[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Routine accessing com port & logging

Posted on 1998-10-23
5
Medium Priority
?
226 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 150 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
Eseutil Hard Recovery is part of exchange tool and ensures Exchange mailbox data recovery when mailbox gets corrupt due to some problem on Exchange server.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

873 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