Tangible Software Solutions

The Most Trusted Name in Source Code Conversion

C++ Equivalent to VB Casts

In native C++, the closest equivalent to the standard VB casting macros (CType and the corresponding CInt, CStr, etc.) is static_cast. In C++/CLI, the closest equivalent are calls to the System::Convert methods if the appropriate method exists, otherwise they are converted to the safe_cast operator. The behavior of both the System::Convert methods and safe_cast are subtly different from the VB casting macros though, so you should always test the behavior of your converted C++ code.

The VB TryCast operator is converted to the C++ dynamic_cast operator.

If you need to convert from VB to C++ and you are depending on the results being reliable and accurate, then you will want to have VB to C++ Converter, the best VB to C++ converter, at your fingertips.

Copyright © 1997 - 2017 Tangible Software Solutions Inc.