VC和VB数据类型对比
来源:互联网 发布:淘宝联盟频道推广 编辑:程序博客网 时间:2024/04/30 18:16
API形式
VC
VB
长度
char
Byte
1 byte
unsignedchar;BYTE
Byte
1 byte
signed char
Byte
1 byte
short
Integer
2 bytes
unsigned short;WORD
Integer
2 bytes
int;BOOL;INT
Long
4 bytes
unsigned int;UINT;WPARAM
Long
4 bytes
long;LPARAM;DWORD
Long
4 bytes
float;FLOAT
Single
4 bytes
double
Double
8 bytes
long double
Double
8 bytes
COM形式
Platform SDK: COMTranslating to Visual Basic from C++
Using the C++ programming language, developers can directly access the memory that stores a particular variable. Memory pointers provide this direct access. In Visual Basic, pointers are handled for you. For example, a parameter declared as a pointer to an int in C++ is equivalent to a parameter declared in Visual Basic as a ByRef Integer.
A parameter that is declared As String in Visual Basic is declared as a pointer to a BSTR in C++. Setting a string pointer to NULL in C++ is equivalent to setting the string to the vbNullString constant in Visual Basic. Passing in a zero-length string ("") to a function designed to receive NULL does not work, as this passes a pointer to a zero-length string instead of a zero pointer.
C++ supports data containers, namely structures and unions, that have no equivalent in Visual Basic. For this reason, COM objects typically wrap information that usually is stored in structures and unions in object classes. Some COM objects, however, may contain structures, causing portions of the object's methods or functionality to be inaccessible to Visual Basic.
Note
Future versions of Visual Basic, version 6.0 and beyond, will support structures.
Some C++ data types are not supported in Visual Basic, for example unsigned types and HWND types. Methods that accept or return these data types are not available in Visual Basic.
Visual Basic uses Automation-compatible data types as its internal data types. Thus, C++ data types that are Automation-compatible are also compatible with Visual Basic. Data types that are not Automation-compatible may not be able to be converted to Visual Basic. For more information about Automation data types, see the Automation documentation in the Platform SDK.
The following table lists the data types are supported by Visual Basic and their VARTYPE equivalents.VARTYPE is an enumeration that lists the Automation variant types.
All parameters in Visual Basic, unless labeled with the keyword ByVal, are passed by reference (as pointers) instead of by value.
C++ and Visual Basic differ slightly in how they represent properties. In C++, properties are represented as a set of accessor functions, one that sets the property value and one that retrieves the property value. In Visual Basic, properties are represented as a single item that can be used to retrieve or set the property value.
- VC和VB数据类型对比
- vc和vb区别
- VC与VB数据类型对应关系
- VC++与VB数据类型对应关系
- VB与VC的数据类型比较
- VB与VC的数据类型比较
- VC++ 与VB 数据类型对应关系
- VC++与VB数据类型对应关系
- VB和c#语法对比
- VC 数据类型和转换
- VB和VC混合编程
- C#和VB.net语法对比图
- C#和VB.net语法对比图
- vb.net 和 c# 语法对比图
- C#和VB.net语法对比图
- C#和VB.net语法对比
- 【C#】—vb和c#实现对比
- VB基础——变量和数据类型
- VB6的快捷键
- 多功能电信号测量仪
- 遍历聚合对象中的元素——迭代器模式(三)
- QT子线程发射信号,UI接收信号刷新UI
- 保护自己的软件----android 签字三种方法
- VC和VB数据类型对比
- [Unity 3D] Unity 3D 性能优化 (一)
- 【通知】广州传智播客.Net精品就业班课程调整及学费调整
- HOWTO: Prepare HTML Help Files for Context-Sensitive Help
- JEECG
- 代码优化--惰性载入函数
- 基本几何变换与图形剪裁现实
- hdu 1874 畅通工程序 解题报告
- flex actionScript时间处理