Discussion:
Upgrading from VC6 to VC2010
(too old to reply)
Me
2012-11-23 21:53:16 UTC
Permalink
I am attempting to upgrade to VS2010 from apps running under VS6
In my main Dialog's .cpp program I have the following under VC6 which works
fine:

BOOL CAdelphiPDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();

ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
BOOL bNameValid;
CString strAboutMenu;
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
ASSERT(bNameValid);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

CRect tabRect;
m_cTab.GetWindowRect(tabRect);
m_rSettingsRect.left = 10; // Set the size and location of child
m_rSettingsRect.top = 40;
m_rSettingsRect.right = tabRect.Width() - 20;
m_rSettingsRect.bottom = tabRect.Height() - 44;

m_dPreset1.Create(IDD_PRESET1, this); // Create the child windows
m_dOptions.Create(IDD_OPTIONS, this);

// rest of sartup code here

return true;
}

When I try the same thing under VC++ 2010 I get error's compiling at the
lines:
m_dPreset1.Create(IDD_PRESET1, this); // Create
the child windows for the main window class
m_dOptions.Create(IDD_OPTIONS, this);

Both lines have the IDD_ tags and this underlined in red and the compiler
states:
error C2660: 'CWnd::Create' : function does not take 2 arguments

It works fine under Visual C++ 6.0 but not under Visual C++ 2010
I am having trouble finding correction info.
These two lines are the only ones giving errors.
Can someone help me with the correction please!
ScottMcP [MVP]
2012-11-25 14:07:14 UTC
Permalink
It is hard to say much without seeing the declaration of m_dPreset1 and the derivation of its type. It looks like the code is intended to call an object derived from CDialog. Is m_dPreset1 derived from CDialog?
Me
2012-11-26 12:43:53 UTC
Permalink
Post by ScottMcP [MVP]
It is hard to say much without seeing the declaration of m_dPreset1 and the derivation of its type. It looks like the code is intended to call an object derived from CDialog. Is m_dPreset1 derived from CDialog?
m_dPreset1 is a CDialog IDD_PRESET1 with Preset1.cpp
m_dOptions is a CDialog IDD_OPTIONS with Options.cpp
These are the two tabs of the TabControl application I am trying to create.
Miles Davies
2013-08-19 08:54:10 UTC
Permalink
Post by Me
I am attempting to upgrade to VS2010 from apps running under VS6
[snip]

Seems like the compiler doesn't know the two member variables are derived from CDialog but thinks they are derived from CWnd.

Without the header code for these classes it is hard to figure out why.

Not enough clues my friend.

Loading...