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(this->hSerial==INVALID_HANDLE_VALUE)
{
//If not success full display an Error
if(GetLastError()==ERROR_FILE_NOT_FOUND){

//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...
http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c2503/