Visual Studio(SerialClass.h (header))&Serial.cpp

Hi, Guys I am trying to use the code for C++ provided at Arduino Playground - HomePage
but I am having problem with it I am getting an error which I have isolated to this
//Check if the connection was successfull
//If not success full display an Error

//Print Error if neccessary
printf("ERROR: Handle was not attached. Reason: %s not available.\n", COM5);

part of the code. For some reason it can't open port com5.
So if you guys could help me out that would be nice.

You need to post more of your code, and tell us more about your system.

When this program is running, is the Arduino connected? What sketch is loaded on it? Is it connected to COM5? Do you have the Serial Monitor window open from the Arduino IDE?

Folks here have had succes with this...