.net compiler error( static cast and std:: problem)

 

Hi, I am doing a porting to 64 bit(VC++ 6.0 -> VC.Net) now.
and encounter these problems. Please help me if you know the solution
1. static cast error
BEGIN_MESSAGE_MAP(CAADlg, CDialog)
//{{AFX_MSG_MAP(CAADlg)
  ON_BN_CLICKED(IDC_A, OnA)
  ON_BN_CLICKED(IDC_B, OnB)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

bool CAADlg::OnA()
{
...
}
void CAADlg::OnB()
{
...
}

Compiler error message:

c:\Works\VC.NET\...cpp(179) : error C2440: 'static_cast' : cannot convert from 'bool (__thiscall CAA::* )(void)' to 'AFX_PMSG'

So the problem is exist when the return value of the function is bool.

2. std:: problem

std::_MIN(...), etc

compiler error message:

error C2589: '(' : illegal token on right side of '::'

Does anyone know the solutions
Your help will be highly appreciated. Thanks^^



Answer this question

.net compiler error( static cast and std:: problem)

  • Mathieu_N

    for c2440 see PSS ID Number: Q195032
  • donnbobhardy

    For the first question, the return type must match. You'll need to change the return type, or provide another function that the message map will forward the message to.

    For the second question, somewhere you have a macro that is defining _MIN to nothing. IntelliSense in the IDE can help you find that macro.

    Hope that helps!

  • chricosta

    I developed a 35 page informational guide and an Introduction that I would like to market on the internet. I would like to convert it to an eBook, but I do not know how. Could you please help me I visited the jansfreeware.com to download its free software to convert my content into am eBook, but I am still lost.

    COULD YOU PLEASE HELP ME WITH THE INFORMATION mY email address is kishmirburke@yahoo.com.

    THank you kindly,

    Kishmir L. Burke



  • .net compiler error( static cast and std:: problem)