The data is flying into that COM port perfectly... I've gone through the Tutorial to make a Win32 CLR Application and that works perfectly too.
The problem is, I need to make this work with a Win32 /MT Application - When I try to tell VC++ to use the Common Language Library it says:
Command line error D8016: '/clr' and '/MT' command-line options are incompatible
When I use ReadFile(blah,blah,blaH) All I get is the bytes... I need the Text that it is sending!
I will seriously PayPal someone $10 for a beer if they can help me get the COM Port Data/Text working!
When I pass the buffer date into a Trace so I can see what it's doiing, it outputs all these garbage characters, not the proper text... I can read COM8 Inside of HyperTerminal properly so I know I have all the Baud/Settings correct...
It's pretty **** frustrating to have it work so easily inside the Win32/CLR Program, and have to use all this API Crap from 1995 to try and work with this
... I've gone through the Tutorial to make a Win32 CLR Application and that works perfectly too.
As I understand it, there is no such thing as a "Win32 CLR Application". A Win32 application is a compiled application (probably but not necessarily written in C or C++) whose output is machine code. A CLR application involves the Common Language Runtime which is a .NET Runtime, whose output is an Intermediate Language (or IL) that can be executed by the .NET Framework. The application is probably (but not necessarily) written in languages like VB.NET, C#, Managed C++, etc.
From the foregoing, it can be understood immediately why /MT is not compliant with /clr. "/MT" would result in use of the static version of the (multi-threaded) run-time library, and a static linking to the run-time library is completely inconsistent with CLR's output of an intermediate language for execution by the .NET framework.
What are you trying to accomplish with the /MT switch, and why do you think you need it?
Perhaps it also would be helpful for you to post a link to the "tutorial" that you followed.
Finally, if you really want a CLR application, then this is the wrong forum.
PS: Quote from ChadReitsma: "Big help on this forum.... "
Turn off the sarcasm. Every single person here is posting because they want to help and because they're highly motivated to do so. If you think you're not getting the help you want, it's almost certainly not due to lack of trying on the part of those posting replies.
Hi guys, Sorry for the sarcasm - it's just really frustrating.
I do appreciate the help.
I have to use the /MT option because the application I am modifying (Half-Life 2) is coded that way - turning it off creates a ton of errors when I try to compile.
I can't use the Naughter Class as it uses MFC which isn't included in VC++ Express 2010 ... I guess I should just go grab a real copy of VC++.
I'll try looking at the WinAPI CreateFile stuff again... I think that's the best bet.
I found a few examples using CSerial... but I was missing this serial.lib, built the library separately, added it to my project and it worked!
For anyone that just needs a quick Copy/Paste Serial Communications Example, here is the header file, Library and .CPP <attached>
Just wanted to say thanks again for the help / push in the right direction.