Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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() :
C++
virtual BOOL InitInstance()
{
    AfxEnableControlContainer();

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

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

    CAppDlg dlg;
    dlg.DoModal();

    return FALSE;
}
and this is nearly identical to what the NewControls sample has. This is only missing the registry stuff.
Posted
Updated 12-Apr-19 18:04pm

1 solution

Add the following code and it will work.
#ifndef _AFXDLL
#include "afxribbon.rc" // Ribbon and control bars
#endif
 
Share this answer
 
Comments
Rick York 13-Apr-19 1:07am    
Yep, I should have seen it. As I mentioned the NewControls sample works and I see now that it has this in it. Thanks.
Michael Haephrati 13-Apr-19 22:35pm    
You are welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900