Cvslistbox加载标准按钮 [英] Cvslistbox loading standard buttons

查看:315
本文介绍了Cvslistbox加载标准按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在对话框中使用CVSListBox类,当我将项目设置为使用静态链接时,SetStandardButtons()调用失败。如果我使用动态链接,它可以正常工作。真正令人困惑的是MFC示例应用程序NewControls与静态链接正常工作。有谁知道我错过了哪一步?



我的尝试:



应用程序在其InitInstance()中有这个:

I am using the CVSListBox class in a dialog and when I set the project to use static linking the SetStandardButtons() call fails. If I use dynamic linking it works correctly. What is really confounding is the MFC sample app NewControls works correctly with static linking. Does anyone know what step I am missing?

What I have tried:

The application has this in its InitInstance() :

virtual BOOL InitInstance()
{
    AfxEnableControlContainer();

    InitCommonControls();
    InitContextMenuManager();
    InitShellManager();

    CMFCVisualManager::SetDefaultManager( RUNTIME_CLASS( CMFCVisualManagerWindows ) );
    CMFCButton::EnableWindowsTheming();

    CAppDlg dlg;
    dlg.DoModal();

    return FALSE;
}

这与NewControls样本几乎完全相同。这只是缺少注册表内容。

and this is nearly identical to what the NewControls sample has. This is only missing the registry stuff.

推荐答案

添加以下代码,它将起作用。

Add the following code and it will work.
#ifndef _AFXDLL
#include "afxribbon.rc" // Ribbon and control bars
#endif


这篇关于Cvslistbox加载标准按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆