文档详情

VC和VB数据类型比较.doc

发布:2017-08-17约6.29千字共6页下载文档
文本预览下载声明
VC和VB数据类型对比 收藏 ?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:?COM Translating 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 objects 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
显示全部
相似文档