首页> 外文期刊>MSDN Magazine >C++ Q&A: Windows 2000 File Dialog Revisited; Autocompletion and the ACTest Demo App
【24h】

C++ Q&A: Windows 2000 File Dialog Revisited; Autocompletion and the ACTest Demo App

机译:C ++问答:重新访问了Windows 2000文件对话框;自动补全和ACTest演示应用程序

获取原文
获取原文并翻译 | 示例

摘要

In my April 2000 C++ Q&A column, I answered a question from a reader who asked how to get the Windows~® 2000-style File | Open dialog (the one with the Places bar) in his MFC app. I said essentially, you can't do it. I should have heeded one of my own favorite sayings,"In programming you can always do anything." To restate the problem, Windows 2000 has a new Open dialog (see Figure 1) with a Places bar on the left side. To invoke the dialog, you must call∷GetOpenFileName, passing it an OPENFILENAME struct. MFC wraps this in the class CFileDialog. The problem is that the most recent OPENFILENAME struct (version 5.0 and later, which means Windows 2000) has additional members that increase its size. Before you (or MFC) call∷GetOpenFileName, you must initialize the first member of OPENFILENAME—lStruct-Size—to sizeof(OPENFILENAME). If you compile for Windows 2000 (_WIN32_WINNT >= 0x0500), you'll get the new size; if you compile for earlier versions of Windows, you'll get the old size.
机译:在2000年4月的C ++问答专栏中,我回答了一个读者的问题,该读者问如何获得Windows〜®2000样式的File |。在他的MFC应用程序中打开对话框(带有位置栏的对话框)。我基本上说过,你做不到。我应该听我自己最喜欢的一句话:“在编程中,您总是可以做任何事情。”为了重述此问题,Windows 2000有一个新的“打开”对话框(请参见图1),左侧有一个“位置”栏。要调用该对话框,您必须调用∷GetOpenFileName,并向其传递一个OPENFILENAME结构。 MFC将其包装在类CFileDialog中。问题是最新的OPENFILENAME结构(版本5.0及更高版本,意味着Windows 2000)具有增加其大小的其他成员。在您(或MFC)调用∷GetOpenFileName之前,必须将OPENFILENAME的第一个成员lStruct-Size初始化为sizeof(OPENFILENAME)。如果为Windows 2000编译(_WIN32_WINNT> = 0x0500),则将获得新的大小;如果为Windows的早期版本进行编译,则将使用旧的大小。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号