没有对话框资源模板,怎样用CreateDialogIndirect()创建模态对话框??

guoj1997 2005-02-22 10:15:16
CreateDialogIndirect()总是返回"找不到映象文件中指定的资源类型"的错误。
...全文
482 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
guoj1997 2005-03-04
  • 打赏
  • 举报
回复
谢谢大家关注,该问题俺已经搞定,DLGTEMPLATE结构后面还有很多相关结构的。
后面还有跟具体的DLGITEMTEMPLATE结构。
如果想创建modal对话框,在CDialog::DoModal()前使用CDialog::InitModalIndirect()就ok了。

下面是一个结构例子:
// 1. DLGTEMPLATE structure
// 2. 0x0000 (Word) indicating the dialog has no menu
// 3. 0x0000 (Word) Let windows assign default class to the dialog
// 4. (Caption) Null terminated unicode string
// 5. 0x000B (size of the font to be used)
// 6. "Arial" (name of the typeface to be used)
// 7. DLGITEMTEMPLATE structure for the button (HAS TO BE DWORD ALIGNED)
// 8. 0x0080 to indicate the control is a button
// 9. (Title). Unicode null terminated string with the caption
// 10. 0x0000 0 extra bytes of data for this control
// 11. DLGITEMTEMPLATE structure for the Static Text (HAS TO BE DWORD ALIGNED)
// 12. 0x0081 to indicate the control is static text
// 13. (Title). Unicode null terminated string with the text
// 14 0x0000. 0 extra bytes of data for this control
// 15. DLGITEMTEMPLATE structure for the Edit Control (HAS TO BE DWORD ALIGNED)
// 16. 0x0082 to indicate an Edit control
// 17. (Text) - Null terminated unicode string to appear in the edit control
// 18. 0x0000. 0 extra bytes of data for this control
老夏Max 2005-03-02
  • 打赏
  • 举报
回复
巧妇难为无米之炊!
=================
同意!
red-fly 2005-03-02
  • 打赏
  • 举报
回复
第二个参数该怎么写?
我有对话框的ID为IDD_DLG_ONE
菜牛 2005-02-22
  • 打赏
  • 举报
回复
巧妇难为无米之炊。

15,980

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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