SerialPort Class Implementation RRS feed

  • Question

  •  Help

    I am a new user of Visual studio 2005 i used Visual studio 6 before and i have to say that i don't understand some part of this new version.

    anyway i'd like to use the class SerialPort  (i believe it is available but maybe not)

    Is it possible to use it ?

    If it is, what header or library do i have to declare in order to use it?


    PS: Why  when the help is filtered to VC++ Only VB JAVA C# examples Come up, is that me  becoming mad?


    Tuesday, April 25, 2006 10:39 AM


All replies

  • The SerialPort class belongs to the :NET Framework. If you want to program managed code you can use it.

    For unmanageged code use

    Tuesday, April 25, 2006 4:37 PM
  • That's what i'am using at the minute but i would like to try to use that feature though.

    i tried to implement manage code, and  i could include system.dll using '#using' and then 'using namespace system' but not 'using namespace system.IO.ports' as it doesn't accept the '.' within the name.

    if i want to use managed  code by changing the option in the project manager what should i do to be able to use the SerialPort class?

    Sorry to ask a separate question but how do we implement string in the unmanaged code as CString is not recognised ?

    What library should i use?




    Tuesday, April 25, 2006 4:57 PM
  • You are not using C# or VB you are using C++ so you have to use ::

    using namespace system::IO::ports;

    Tuesday, April 25, 2006 5:57 PM