Home > Software engineering >  Sprout new consult C2061 syntax errors: the identifier "dest
Sprout new consult C2061 syntax errors: the identifier "dest

Time:11-16

I am using vs2019 + opencv4.2.0 MFC window images show
Code:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//MFCApplication1Dlg. CPP: implementation file
//

# include "PCH. H"
//# include "LoadImage. H"
//# include "LoadImageDlg. H"
//# include "afxdialogex. H"
# include "framework. H"
# include "MFCApplication1. H"
# include "MFCApplication1Dlg. H"


# ifdef _DEBUG
# define new DEBUG_NEW
# endif


#include
#include
#include
#include
using namespace cv;
using namespace std;

Cstrings CSTR.
String STR.
Mat frame;
HWND viewhWnd=NULL;
HWND hParent=NULL;


//for application "about" menu item CAboutDlg dialog

The class CAboutDlg: public CDialogEx
{
Public:
CAboutDlg ();

//data dialog
# ifdef AFX_DESIGN_TIME
Enum {IDD=IDD_ABOUTBOX};
# endif

Protected:
Virtual void DoDataExchange (CDataExchange * symbol;//support DDX/DDV

//implementation
Protected:
DECLARE_MESSAGE_MAP ()
};

CAboutDlg: : CAboutDlg () : CDialogEx (IDD_ABOUTBOX)
{
}

Void CAboutDlg: : DoDataExchange (CDataExchange * symbol)
{
CDialogEx: : DoDataExchange (symbol);
}

BEGIN_MESSAGE_MAP (CAboutDlg CDialogEx)
END_MESSAGE_MAP ()


//CMFCApplication1Dlg dialog



CMFCApplication1Dlg: : CMFCApplication1Dlg (CWnd *=nullptr pParent/* */)
: CDialogEx (IDD_MFCAPPLICATION1_DIALOG, pParent)
{
M_hIcon=AfxGetApp () - & gt; LoadIcon (IDR_MAINFRAME);
}

Void CMFCApplication1Dlg: : DoDataExchange (CDataExchange * symbol)
{
CDialogEx: : DoDataExchange (symbol);
}

BEGIN_MESSAGE_MAP (CMFCApplication1Dlg CDialogEx)
ON_WM_SYSCOMMAND ()
ON_WM_PAINT ()
ON_WM_QUERYDRAGICON ()
ON_BN_CLICKED (IDC_BUTTON1, & amp; CMFCApplication1Dlg: : OnBnClickedButton1)
END_MESSAGE_MAP ()


//CMFCApplication1Dlg message handler

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

//will "about... "Menu item added to the system menu,

//IDM_ABOUTBOX must be in the system command range,
ASSERT ((IDM_ABOUTBOX & amp; 0==IDM_ABOUTBOX xfff0));
ASSERT (IDM_ABOUTBOX & lt; 0 xf000);

CMenu * pSysMenu=GetSystemMenu (FALSE);
If (pSysMenu!=nullptr)
{
BOOL bNameValid;
Cstrings strAboutMenu;
BNameValid=strAboutMenu. LoadString (IDS_ABOUTBOX);
ASSERT (bNameValid);
if (! StrAboutMenu. IsEmpty ())
{
PSysMenu - & gt; The AppendMenu (MF_SEPARATOR);
PSysMenu - & gt; AppendMenu (MF_STRING IDM_ABOUTBOX, strAboutMenu);
}
}

//set this dialog ICONS, when the application is the main window is not a dialog, the framework will automatically
//do this
SetIcon (m_hIcon, TRUE);//set the large icon
SetIcon (m_hIcon, FALSE);//set the small icon

//TODO: add additional initialization code in the

return TRUE;//unless set focus to the control, return TRUE
}

Void CMFCApplication1Dlg: : OnSysCommand (UINT nID, LPARAM LPARAM)
{
If ((nID & amp; 0 xfff0)==IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
DlgAbout. DoModal ();
}
The else
{
CDialogEx: : OnSysCommand (nID, lParam);
}
}

//if the dialog box to add a minimize button, you need the following code
//to draw the icon, to use the document/view model of MFC application,
//it will be done automatically by the framework,

Void CMFCApplication1Dlg: : OnPaint ()
{
If (IsIconic ())
{
CPaintDC dc (this);//for drawing device context

The SendMessage (WM_ICONERASEBKGND, reinterpret_cast & lt; WPARAM> (dc) GetSafeHdc ()), 0);

//make the icon is centered within the workspace rectangular
Int cxIcon=GetSystemMetrics (SM_CXICON);
Int cyIcon=GetSystemMetrics (SM_CYICON);
CRect the rect.
GetClientRect (& amp; The rect);
Int x=(the rect. Width () - cxIcon + 1)/2;
Int y=(the rect. Height () - cyIcon + 1)/2;

//draw the icon
Dc. DrawIcon (x, y, m_hIcon);
}
The else
{
CDialogEx: : OnPaint ();
}
}

//when the user drag minimize window system call this function to obtain the cursor
//show,
HCURSOR CMFCApplication1Dlg: : OnQueryDragIcon ()
{
Return static_cast & lt; HCURSOR> (m_hIcon);
}



Void CMFCApplication1Dlg: : OnBnClickedButton1 ()
{
//TODO: add the control notification handler code
CvDestroyWindow (" myshowWnd ");
Cstrings x;
SetDlgItemText (IDC_IMG_PATH, x);
/* CFileDialog DLG (TRUE, "*. *" "*. *", OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"The JPEG files (*.jpg) | *. JPG | GIF (*. GIF) | *. GIF (*. BMP) | | BMP file *. BMP (*. *) | | file *. * |", NULL); */
CFileDialog DLG (TRUE, _T (" *.jpg "), NULL,
OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY, NULL, NULL);
If (DLG) DoModal ()==IDOK)
{
SetDlgItemText (IDC_IMG_PATH, DLG. GetPathName ());
CSTR=DLG. GetPathName ();
//STR=(LPCSTR) (LPCTSTR CSTR);
STR="yaowan1. BMP";
NamedWindow (" view ", WINDOW_AUTOSIZE);
ViewhWnd=(HWND) cvGetWindowHandle (" the view ");
HParent=: : GetParent (viewhWnd);
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related