Google
 
Web itpro-blogger.blogspot.com
土曜日, 4月 28, 2007

[C++]VBA・VB2005への型変換

[Wtypes.hに含まれるアンマネージ型]:[アンマネージC言語型]:[マネージクラス名]:[説明][HANDLE]:[void*]:[System.IntPtr]:[32ビット]

[BYTE]:[unsigned]:[char]:[System.Byte]:[8ビット]

[SHORT]:[short]:[System.Int16]:[16ビット]

[WORD]:[unsigned]:[short]:[System.UInt16]:[16ビット]

[INT]:[int]:[System.Int32]:[32ビット]

[UINT]:[unsigned]:[int]:[System.UInt32]:[32ビット]

[LONG]:[long]:[System.Int32]:[32ビット]

[BOOL]:[long]:[System.Int32]:[32ビット]

[DWORD]:[unsigned]:[long]:[System.UInt32]:[32ビット]

[ULONG]:[unsigned]:[long]:[System.UInt32]:[32ビット]

[CHAR]:[char]:[System.Char]:[ANSIにより装飾]

[LPSTR]:[char*]:[System.StringまたはSystem.StringBuilder]:[ANSIにより装飾]

[LPCSTR]:[Const]:[char*]:[System.StringまたはSystem.StringBuilder]:[ANSIにより装飾]

[LPWSTR]:[wchar_t*]:[System.StringまたはSystem.StringBuilder]:[Unicodeにより装飾]

[LPCWSTR]:[Const]:[wchar_t*]:[System.StringまたはSystem.StringBuilder]:[Unicodeにより装飾]

[FLOAT]:[Float]:[System.Single]:[32ビット]

[DOUBLE]:[Double]:[System.Double]:[64ビット]


[クラス名]:[説明]:[Visual Basic のデータ型]:[C# のデータ型]:[C++ マネージ拡張のデータ型]:[JScript のデータ型]
●整数
[Byte]:[8ビット符号なし整数]:[Byte]:[byte]:[char]:[Byte]

[SByte]:[8ビット符号付き整数(非CLS準拠)]:[SByte(非組み込み型)]:[sbyte]:[signed char]:[SByte]

[Int16]:[16ビット符号付き整数]:[Short]:[short]:[short]:[short][Int32]:[32ビット符号付き整数]:[Integer]:[int]:[intまたはlong]:[int]

[Int64]:[64ビット符号付き整数]:[Long]:[long]:[__int64]:[long]

[UInt16]:[16ビット符号なし整数(非CLS準拠)]:[UInt16(非組み込み型)]:[ushort]:[unsigned short]:[UInt16]

[UInt32]:[32ビット符号なし整数(非CLS準拠)]:[UInt32(非組み込み型)]:[uint]:[unsigned intまたはunsigned long]:[UInt32]

[UInt64]:[64 ビット符号なし整数(非CLS準拠)]:[UInt64(非組み込み型)]:[ulong]:[unsigned __int64]:[UInt64]

●浮動小数点数
[Single]:[単精度 (32 ビット) 浮動小数点数]:[Single]:[float]:[float]:[float]
[Double]:[倍精度 (64 ビット) 浮動小数点数]:[Double]:[double]:[double]:[double]

●論理型
[Boolean]:[ブール値 (true または false)]:[Boolean]:[bool]:[bool]:[bool]

●その他
[Char]:[Unicode (16 ビット) 文字]:[Char]:[char]:[wchar_t]:[char]

[Decimal]:[96ビット10進値]:[Decimal]:[decimal]:[Decimal]:[Decimal]

[IntPtr]:[基になるプラットフォームによってサイズが決まる符号付き整数 (32 ビットのプラットフォームでは 32 ビット値、64 ビットのプラットフォームでは 64 ビット値) ]:[IntPtr(非組み込み型)]:[IntPtr(非組み込み型)]:[IntPtr(非組み込み型)]:[IntPtr]

[UIntPtr]:[基になるプラットフォームによってサイズが決まる符号なし整数 (32 ビットのプラットフォームでは 32 ビット値、64 ビットのプラットフォームでは 64 ビット値)(非CLS準拠)]:[UIntPtr(非組み込み型)]:[UIntPtr(非組み込み型)]:[UIntPtr(非組み込み型)]:[UIntPtr]

●クラス オブジェクト
[Object]:[オブジェクト階層構造のルート]:[Object]:[object]:[Object*]:[Object]
[String]:[Unicode 文字の不変固定長文字列]:[String]:[string]:[String*]:[String]


[整数型のサイズ]:[Visual Basic 6.0 の型と識別子の型文字]:[Visual Basic 2005 の型と識別子の型文字]:[共通言語ランタイム (CLR) の型]

[8ビット、符号付き]:[(なし)]:[SByte (なし)]:[System.SByte]

[8ビット、符号なし]:[Byte (なし)]:[Byte (なし)]:[System.Byte]

[16ビット、符号付き]:[Integer (%)]:[Short (なし)]:[System.Int16]

[16ビット、符号なし]:[(なし)]:[UShort (なし)]:[System.UInt16]

[32ビット、符号付き]:[Long (&)]:[Integer (%)]:[System.Int32]

[32ビット、符号なし]:[(なし)]:[UInteger (なし)]:[System.UInt32]

[64ビット、符号付き]:[(なし)]:[Long (&)]:[System.Int64]

[64ビット、符号なし]:[(なし)]:[ULong (なし)]:[System.UInt64]

32 ビット システムでは、32 ビット整数の演算の方が、16 ビットまたは 64 ビットの整数演算よりも高速です。つまり、Visual Basic 2005 では、Integer と UInteger は、効率の優れた基本的な数値型です。Visual Basic 2005 に移行するときに Long 宣言を Integer(Int32) に変更すると、アプリケーションのパフォーマンスを向上させることができます。

■参考サイト
プラットフォーム呼び出しによるデータのマーシャリング
http://msdn.microsoft.com/library/ja/default.asp?url=/library/ja/cpguide/html/cpconmarshalingdatawithplatforminvoke.asp
.NET Framework クラス ライブラリの概要
http://msdn.microsoft.com/library/ja/default.asp?url=/library/ja/cpguide/html/cpconthenetframeworkclasslibrary.asp






Comments: コメントを投稿

<< Home

This page is powered by Blogger. Isn't yours?