获取指向给定表中指定列和行的单元格中包含的值的指针。
Syntax
HRESULT GetColumn (
[in] ULONG ixTbl,
[in] ULONG ixCol,
[in] ULONG rid,
[out] ULONG *pVal
);
Parameters
ixTbl [in]表的索引。
ixCol [in]表中列的索引。
rid [in]表中行的索引。
pVal [out]指向单元格中值的指针。
Remarks
返回 pVal 的值的解释取决于列的类型。 可以通过调用 IMetaDataTables.GetColumnInfo 来确定列类型。
-
GetColumn 方法自动将 Rid 或 CodedToken 类型的列转换为完整的 32 位
mdToken值。 - 它还会自动将 8 位或 16 位值转换为完整的 32 位值。
- 对于 堆 类型列,返回 的 pVal 将是相应堆中的索引。
| Column type | pVal contains | Comment |
|---|---|---|
0..iRidMax(0..63) |
mdToken | pVal 将包含完整的令牌。 该函数会自动将 Rid 转换为完整令牌。 |
iCodedToken..iCodedTokenMax(64..95) |
mdToken | 返回后, pVal 将包含完整的令牌。 该函数自动将 CodedToken 解压缩到完整令牌中。 |
iSHORT (96) |
Int16 | 自动将签名扩展到 32 位。 |
iUSHORT (97) |
UInt16 | 自动将签名扩展到 32 位。 |
iLONG (98) |
Int32 | |
iULONG (99) |
UInt32 | |
iBYTE (100) |
Byte | 自动将签名扩展到 32 位。 |
iSTRING (101) |
字符串堆索引 | pVal 是字符串堆中的索引。 使用 IMetadataTables::GetString 获取实际的列 String 值。 |
iGUID (102) |
Guid 堆索引 | pVal 是 Guid 堆中的索引。 使用 IMetadataTables::GetGuid 获取实际列 Guid 值。 |
iBLOB (103) |
Blob 堆索引 | pVal 是 Blob 堆中的索引。 使用 IMetadataTables::GetBlob 获取实际的列 Blob 值。 |
Requirements
平台: 请参阅 .NET 支持的作系统。
Header: Cor.h
Library: CorGuids.lib
.NET 版本 自 .NET Framework 2.0 起可用