2009-09-16

.NET, or the solution to a problem that didn't exist

So, you're using Visual Studio Express and you want to use that supposedly nice SerialPort .NET class (after spending more than half a day trying to make a standard COM port app that can talk nicely to putty - hint: don't rely on anything else but putty's actual port initialization code if you want something that works!).

And yeah, you're like me, so you don't care much about whatever the hell .NET brings to the OO paradigm. You just want to use a class that works ASAP, so you followed the tutorials on the net that tell you: "Just add a 'using namespace System::IO::Ports;' and then you can define a SerialPort instance", which you promptly did.

But now, of course, you're getting the bleeping error:
error C2039: 'Ports' : is not a member of 'System::IO'
Yeah, that's because with all this supposedly improved technology, Visual Studio is still not able to tell you that you need to add a
#include "system.dll"

before you can see ALL of the System namespace. "Intellisense", my ass!

In short: C0239 = need to add a #include to a dll (?!?, when did that become a C++ standard) BEFORE you can start using "using namespace"

Oh, and good luck figuring that one out if you don't (want to) have a clue about .NET...

No comments:

Post a Comment

Note: only a member of this blog may post a comment.