About .NET Framework Data Types

This section contains the information you need to translate the script-oriented Object Model Reference into Microsoft .NET Framework base data types. The Windows Media Player script reference has almost all the information you need to use the Windows Media Player control in a .NET Framework-based program, and in most cases, the syntax will be similar to that of other scripting languages such as Microsoft JScript.

The Windows Media Player reference provides the JScript data type and, if necessary, the C++ conversion. For example, a Number might be returned by a method. JScript treats all numbers in the same way, but other languages distinguish between different types of numbers (integer, floating point, and so on). The reference gives the C++ conversion for number data types because numbers can be processed differently by C++. For example, C++ uses the int data type for integer arithmetic and float for floating point.

The .NET Framework uses a slightly different system of base data types. The following table shows the differences in the common data types you are likely to use. For more information on .NET Framework base data types and the conversion to other data type systems, see the .NET Framework Developer's Guide discussion of System Namespace base data types.

This table gives the .NET Framework class name and the C# data type. Data types for other languages are defined for each language in their respective language references.

Script data type C++ data type .NET Framework class (C# data type )
NumberintInt32 (int)
NumberlongInt32 (int)
NumberdoubleDouble (double)
NumberfloatSingle (float)
StringBSTRString (string)
BooleanVARIANT_BOOLBoolean (bool)
ObjectObjectObject (object)


If you are using Visual Studio, you can use the Microsoft IntelliSense technology to determine what data type is expected for a specific function.

Related topics

Embedding the Windows Media Player Control in a .NET Framework Solution
Object Model Reference for Scripting