Click here to Skip to main content
15,923,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having a heck of a lot of trouble finding and knowing how to use some code so that I can use a com port.

I have even downloaded code form this site and I can not figure out how to use it. There seems to be no int main () to any of it.

I've bought a book, but it must be to old to use with either visual studio 2008 or 2010.

If anybody can put me on track, I would very much appreciate it.

[Update]
I found out last night that my real problem is I do not know how to use Visual Studio 2008 C++ properly. You see, I studied two books and worked only from the console (Using namespace.std). So now these projects all use, I guess you could call them, GUI interfaces.
It has completely flabbergasted me. I come froma background where I wrote programs for microprocessors which communicate via RS232/422. So I picked C++ as the language to write some computer based programs since the code would transfer so easy.
I thought I knew more or less how to handle Visual Studio 2008 for C# GUI applications. And I figured it would be much the same for C++.
SI last night, I found another program written by Written by Shibu K.V (shibukv@erdcitvm.org) which I downloaded form this website.
I do not know where to write my code. I see no int main () in it anywhere, so I do not see a starting point. It compiles OK, but I do not know where I can write my stuff in there.
I'll look at the program you suggested when I get a little more time tonight. But my real problem is figuring out how to interface with the darn windows based GUI.
[/Update]
Posted
Updated 14-Jun-11 7:50am
v2
Comments
Sergey Alexandrovich Kryukov 14-Jun-11 1:58am    
What's your question?
--SA
strogg 14-Jun-11 12:02pm    
Here's a good article & a library with source
http://www.codeproject.com/KB/system/serial.aspx

1 solution

Windows applications haven't the main function (the have the WinMain[^] entry point, moreover if you are using a framework like MFC, such function is hidden).

You should read a good tutorial on Windows programming (or play a bit with Visual Studio generated skeleton for a Win32 or MFC application).

Usually you may directly use Win32 API (i.e. you don't need third party libraries) for serial communication, their usage is pretty straightforward, see for instance "Using Communication Resources"[^] at MSDN.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900