这段代码有什么问题吗?

ren20 2001-03-26 07:29:00
编译通过,但是运行出现 “终止” “重试” “忽略”
CFileDialog TFileDlg(TRUE,"*.trk",NULL,OFN_HIDEREADONLY,"Terrain File(*.ter)|*.ter||",NULL);
TFileDlg.m_ofn.Flags=OFN_ALLOWMULTISELECT;
TFileDlg.m_ofn.lpstrFile="Terrain File Dialog ";
TFileDlg.m_ofn.nMaxFile=4096;

if(TFileDlg.DoModal()==IDOK)
{

}
...全文
538 14 打赏 收藏 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jans 2001-03-27
  • 打赏
  • 举报
回复
没有分配Buffer嘛
kevin_gao 2001-03-27
  • 打赏
  • 举报
回复
VC+BCB不好吗?都是C++的东西应该不错吧,我以为。虽然BCB我不太懂!
ren20 2001-03-26
  • 打赏
  • 举报
回复
谢谢,我的程序已经好了,多亏了大家的帮助

请问,我原来的程序那里出了问题?
Jans 2001-03-26
  • 打赏
  • 举报
回复
这样好像可以了
char szFiles[4096];
CFileDialog TFileDlg(TRUE,"*.trk",NULL,OFN_HIDEREADONLY,"Terrain File(*.ter)|*.*||",NULL);
TFileDlg.m_ofn.Flags|=OFN_ALLOWMULTISELECT;
strcpy(str," All Files");
TFileDlg.m_ofn.lpstrFile=szFiles;
TFileDlg.m_ofn.nMaxFile=4096;
if(TFileDlg.DoModal()==IDOK)
{

}
Jans 2001-03-26
  • 打赏
  • 举报
回复
Specifies that the File Name list box allows multiple selections. If you also set the OFN_EXPLORER flag, the dialog box uses the Explorer-style user interface; otherwise, it uses the old-style user interface.
If the user selects more than one file, the lpstrFile buffer returns the path to the current directory followed by the file names of the selected files. The nFileOffset member is the offset, in bytes or characters, to the first file name, and the nFileExtension member is not used. For Explorer-style dialog boxes, the directory and file name strings are NULL separated, with an extra NULL character after the last file name. This format enables the Explorer-style dialog boxes to return long file names that include spaces. For old-style dialog boxes, the directory and file name strings are separated by spaces and the function uses short file names for file names with spaces. You can use the FindFirstFile function to convert between long and short file names.

If you specify a custom template for an old-style dialog box, the definition of the File Name list box must contain the LBS_EXTENDEDSEL value.
ren20 2001-03-26
  • 打赏
  • 举报
回复
能不能当对话框打开时, 设置缺省目录为 d:\abc
ren20 2001-03-26
  • 打赏
  • 举报
回复
对话框只显示 扩展名为 trk 的文件。
joke100 2001-03-26
  • 打赏
  • 举报
回复
是不是搞错了呀。。。

char bigBuff[2048] = ""; // maximum common dialog buffer size
char szFilter[] =
"All Files (*.*)|*.*|Text Files (*.txt)|*.txt||";
CFileDialog dlg(TRUE, NULL, NULL,
OFN_ALLOWMULTISELECT, szFilter);

// Modify OPENFILENAME members directly to point to bigBuff
dlg.m_ofn.lpstrFile = bigBuff;
dlg.m_ofn.nMaxFile = sizeof(bigBuff);

dlg.DoModal();
ren20 2001-03-26
  • 打赏
  • 举报
回复
TFileDlg.m_ofn.Flags=OFN_ALLOWMULTISELECT;
TFileDlg.m_ofn.lpstrFile="Terrain File Dialog ";
TFileDlg.m_ofn.nMaxFile=4096;

我把这3句去掉,就可以运行了,怎么回事?
ren20 2001-03-26
  • 打赏
  • 举报
回复
怎么改,高手?
joke100 2001-03-26
  • 打赏
  • 举报
回复
If the OFN_ALLOWMULTISELECT flag is set and the user selects multiple files, the m_ofn.lpstrFile contains the current directory followed by the file names of the selected files.
ren20 2001-03-26
  • 打赏
  • 举报
回复
2位的方法还是不行呀
panda_w 2001-03-26
  • 打赏
  • 举报
回复
把最后参数改为this试试
joke100 2001-03-26
  • 打赏
  • 举报
回复
增加一句
TFileDlg.m_ofn.hInstance = AfxGetInstanceHandle();


内容概要:本文针对传统彩色数字图像加密算法存在的密钥空间有限、随机性不足及抗干扰能力弱等问题,提出一种结合混沌系统与DNA编码的复合型彩色图像加密解密方案。通过混沌系统生成伪随机序列,对图像RGB三通道像素进行置乱与混淆,并利用DNA编码规则实现信息的高维扩散与并行处理,从而提升加密强度与安全性。文章重点对该方案的抗噪声与抗裁剪性能进行了系统性分析,实验结果表明该算法具备大密钥空间、强加密随机性,且在面对高斯噪声、椒盐噪声干扰及不同程度裁剪攻击时仍能较好恢复图像内容,展现出优良的鲁棒性与实用性。; 适合人群:具备一定图像处理、密码学基础知识的科研人员及研究生,或从事信息安全、多媒体通信领域的技术人员。; 使用场景及目标:①应用于网络环境下的彩色图像安全传输与私密存储,防范信息窃取与篡改;②为高鲁棒性图像加密技术的研究提供理论支持与实验验证,推动复合加密算法在实际工程中的落地应用。; 阅读建议:建议读者结合文中提出的加密流程与实验设计,自行复现算法并对不同类型的图像数据进行测试,重点关注混沌参数敏感性、DNA编码规则选择及不同干扰场景下的解密效果,以深入理解算法的抗干扰机制与优化空间。
【不讲道理,只给数据】网上讲 JS 性能的文章大多只给结论不给数据。这个包把 8 个常见优化手法真的跑了一遍,把耗时与提速倍数写出来——包括 3 项「优化后反而更慢」的结果。 ■ 实测(本机 node 实跑,见包内 04 文件) · 按 id 查找:Map 代替 find → 680 倍 · 数组去重:Set 代替双重循环 → 90 倍 · 记忆化递归:加缓存 → 800 倍 · 深拷贝:structuredClone 反而比 JSON 慢(0.44x) · 字符串拼接:现代 V8 下 += 与 join 几乎无差别(0.9x) ■ 资源内容 · 01_优化实战/:bench.js + run_all.js,8 项 before/after 基准,可直接跑,也能改成测你自己的代码 · 02_单元测试示例/:6 个工具函数 + Node 内置测试器写的测试(零依赖,不用装 Jest) · 03_工程化配置模板/:ESLint 9 扁平配置、Prettier、Vite 手动分包、Webpack 5 持久化缓存、package.json 脚本 + 逐项说明 · 04/05 真实运行结果:程序实跑输出,非手写示例 · 06_优化清单30条.md:每条标注实测结论 · 07_自检脚本:一键重跑测试与基准 ■ 使用方法 1)只需 Node 18+,不用 npm install:node 01_优化实战/run_all.js 即可看对比表 2)单元测试:cd 02_单元测试示例 && node --test 3)用 bench.js 量你项目里最慢的函数,先记基线再动手改 4)工程化配置直接拷进项目,重点看 03 里「为什么这么配」 ■ 说明 全部代码原创,可直接用于你的项目。基准数字因 CPU 与 Node 版本略有差异,趋势一致。

16,550

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

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