wince VC++ 对话框打不开的问题

原创 2007年09月11日 18:28:00

对话框有模式对话框和非模式对话框,一般情况下大家都会用到模式对话框
调用方法为:
一.有模式对话框:
1. int DialogBox(
HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
This function creates a modal dialog box from a dialog box template resource. DialogBox does not return control until the

specified callback function terminates the modal dialog box by calling the EndDialog function.

2. int DialogBoxParam(
HINSTANCE hInstance,
LPCTSTR lpTemplateName,
HWND hWndParent,
DLGPROC lpDialogFunc,
PARAM dwInitParam
);

This function creates a modal dialog box from a dialog box template resource. Before displaying the dialog box, the

function passes an application-defined value to the dialog box procedure as the lParam parameter of the WM_INITDIALOG

message. An application can use this value to initialize dialog box controls.

3. int DialogBoxIndirect(
HINSTANCE hInstance,
LPDLGTEMPLATE lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
This function is defined as a macro and creates a modal dialog box from a dialog box template in memory. The DialogBoxIndirect macro does not return control until the specified callback function terminates the modal dialog box by calling the EndDialog function.

4. int DialogBoxIndirectParam(
HINSTANCE hInstance,
LPCDLGTEMPLATE hDialogTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM dwInitParam
);
This function creates a modal dialog box from a dialog box template in memory. Before displaying the dialog box, the function passes an application-defined value to the dialog box procedure as the lParam parameter of the WM_INITDIALOG message. An application can use this value to initialize dialog box controls.


二.无模式对话框
1. HWND CreateDialog(
HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
This function creates a modeless dialog box from a dialog box template resource.

2. HWND CreateDialogIndirect(
HINSTANCE hInstance,
LPCDLGTEMPLATE lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
This function creates a modeless dialog box from a dialog box template in memory.

3. HWND CreateDialogParam(
HINSTANCE hInstance,
LPCTSTR lpTemplateName,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM dwInitParam
);
This function creates a modeless dialog box from a dialog box template resource. Before displaying the dialog box, it passes an application-defined value to the dialog box procedure as the lParam parameter of the WM_INITDIALOG message. An application can use this value to initialize dialog box controls.

4. HWND CreateDialogIndirectParam(
HINSTANCE hInstance,
LPCDLGTEMPLATE lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM lParamInit
);
This function creates a modeless dialog box from a dialog box template in memory. Before displaying the dialog box, the function passes an application-defined value to the dialog box procedure as the lParam parameter of the WM_INITDIALOG message. An application can use this value to initialize dialog box controls.

若用到需要标签的对话框则需要用到属性表或者是TabControl 控件

我用TabControl 控件实现对话框中标签的功能。其中用到了TCITEM 结构体。

在dll程序中用DialogBox()函数可以调出对话框,标签可以正常显示,但是在exe 程序中就调不出对该对话框了,更怪的是将TabControl 空间去掉,就可以调出对话框了。不知是什么原因?
经过一段时间的查找。原来在Exe程序中,需在调出对话框之前加上InitCommonControls();
void InitCommonControls(void);
This function registers and initializes the common control window classes. This function is obsolete. New applications should use the InitCommonControlsEx function.

终于可以打开带书签的对话框了。

Best Regards To All!
 

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

vc++6.0工程拷贝到另外一个地方,会出现功能不全或者打不开工程解决方案

vc++6.0工程拷贝到另外一个地方,会出现功能不全或者打不开工程解决方案如下: 1)若工程涉及到数据库,应配置数据库文件至该工程目录下(控制面板->管理工具->数据源ODBC); 2)  若无上...

解决sal打不开的问题

  • 2015-11-13 21:14
  • 27KB
  • 下载

win7 32位下VC++6.0的安装以及打不开文件的教程

现在网上的版本就可以用的,只要在装的时候注意下就行了。下面给个装的步骤,自己装吧。 可以肯定的说,win7是可以安装VC6.0的,而且还比XP更稳定。一次也没有死过。在XP下可是得同时把任务管理器也...

修复网页打不开问题

  • 2012-08-21 13:09
  • 887B
  • 下载

win7 64位VC串口控件打不开解决方法

写了个MSComm的串口通信程序,在没有安装Vc的机器上没有办法运行。需要手动注册控件。不过手动注册可以写成bat文件来完成。首先是建一个文件夹,64位系统将Windows/SysWOW64(32位系...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)