GetFormat 方 法
确定在 OLE 拖放 DataObject 中指定格式的数据是否可用 只在设计时可用
语 法
oDataObjec t .GetFormat( nFormat | cForma t)
参 数 描 述
nFormat | cFormat
指 定 要 获 取 数 据 的 格 式 下 表 列 出 了 每 种 数 据 格 式 的 值 以 及 说 明
DataObject 自 动 支 持 下 列 格 式 还 有 其 他 格 式 可 用 但 是 需 要 额 外 的 编
程 有 关 可 用 数 据 格 式 的 详 细 内 容 请 在 M icrosoft Developer Network 中查 看 有 关 V isual C++ 的 文 档 通 过 为 指 定 唯 一 的 字 符 串 也 可 以 创 建 自 己 的格 式
数 据 格 式 * nFormat | 说 明
cFormat
CF_TEXT 1 文本格式 .
CF_OEMTEXT 7 包含 OEM 字符集中字符的文本格式
CF_UNICODETEXT 13 Unicode 文本格式 只在
Windows NT 下可用
续 表
CF_FILES or CF_HDROP 15 一个标识一组文件的句柄 例如从 W indows 资源管理器拖来的一组文件
CFSTR_OLEVARIANTARRAY “ OLE Variant
Array ”
一 个 Visual FoxPro 数 组 使用这个格式在一次 拖放 中可以传送多个
值 例如 这 个 格 式 可
以 用 于 将 列 表 框 中 的一 些 项 拖 动 到 另 一 个列 表 框 中
CFSTR_OLEVARIANT
“ OLE Varian t” 一 个 Visual FoxPro 变量 Visual FoxPro 中的所有数据类型都可以用变量代表 这个格式可以 用 于 拖 放 Visual FoxPro 数据 并且不丢失数据类型
CFSTR_VFPSOURCEOBJ
ECT
* 在 FOXPRO.H 中定义
说 明
“ VFP Source Objec t”
对一个 Visual FoxPro 对象 的引用
如果 DataObject 包含 在 nFormat 或 cFormat 中指定格式的数据 则 GetFormat 方法返回 真 (.T.) 否则 返回 假 (.T.)
应 用 于
DataObject 对 象
请 参 阅
ClearData 方 法 , GetData 方 法 , OLE drag-and-drop 概 览 , SetData 方 法 , SetFormat 方 法