Anil:
You may be getting 2 products confused. For C++, you use the ComponentWorks++ tools for Microsoft Visual C++. For Visual Basic, you use the ComponentWorks ActiveX controls.
A simple C++ VISA serial program follows. In additon to the port settings, it changes the termchar to carriage return '\r' and the timeout to 5 seconds:
CNiVisaSession io ("ASRL1::INSTR");
io.SetAttribute (VisaSerialBaudRate,115200);
io.SetAttribute (VisaSerialDataBits,7);
io.SetAttribute (VisaTerminationChar,0x0D);
io.SetAttribute (VisaTimeout,5000);
io.Write ("*IDN?\n");
CString buf;
io.Read (buf, 1024);
cout << "Identity: " << buf << endl;
Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments