懂VC的delphi程序员,请帮忙看一下

博旺软件 2003-10-02 11:47:33
以下是从MSDN拷贝过来的,我感觉有错,请帮忙看一下.
for (i=0; ICInfo(fccType, i, &icinfo); i++)
{
hic = ICOpen(icinfo.fccType, icinfo.fccHandler, ICMODE_QUERY);
if (hic)
{
// Skip this compressor if it can't handle the format.
if (fccType == ICTYPE_VIDEO && pvIn != NULL &&
ICDecompressQuery(hic, pvIn, NULL) != ICERR_OK)
{
ICClose(hic);
continue;
}

// Find out the compressor name.
ICGetInfo(hic, &icinfo, sizeof(icinfo)); //就是这句,我想他应该在ICClose之前

// Add it to the combo box.
n = ComboBox_AddString(hwndC,icinfo.szDescription);
ComboBox_SetItemData(hwndC, n, hic);
}
}
...全文
82 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
poweruser 2003-10-16
  • 打赏
  • 举报
回复
// Skip this compressor if it can't handle the format.
if (fccType == ICTYPE_VIDEO && // 如果两个相等
pvIn != NULL && // 并且pvIn不为空
ICDecompressQuery(hic, pvIn, NULL) != ICERR_OK // 并且函数执行不成功
)
{ // 就会把hic关闭
ICClose(hic);
continue;
}

// 当上面的if不成立的时候执行下面的语句

// Find out the compressor name.
ICGetInfo(hic, &icinfo, sizeof(icinfo)); //就是这句,我想他应该在ICClose之前

这段代码是没有错误的
aiirii 2003-10-15
  • 打赏
  • 举报
回复
我不覺得有錯啊, 是你自己理解的問題??而且,你貼出來的代碼也不夠可以調試!!!
博旺软件 2003-10-15
  • 打赏
  • 举报
回复
好像没有人答对。
请你们先用delphi试了 再说。
flyinwuhan 2003-10-04
  • 打赏
  • 举报
回复
ICDecompressQuery

Decompress就是解压缩嘛!
解压缩失败就continue否则就Get
没有任何错误!
ly_liuyang 2003-10-03
  • 打赏
  • 举报
回复
对VC研究很有限

我看就没问题
Query失败,才检查Info,这都是合理的
aiirii 2003-10-03
  • 打赏
  • 举报
回复
ICClose(hic);
continue;
注意 continue; 關閉後,就執行下個循環了!!!

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧