⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ddns_queryip.cpp

📁 它是一个可以实时交互的嵌入式软件系统
💻 CPP
字号:
// DDNS_QueryIP.cpp : implementation file
//

#include "stdafx.h"
#include "netsdkdemo.h"
#include "DDNS_QueryIP.h"
#include "NetSDKDemoDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDDNS_QueryIP dialog


CDDNS_QueryIP::CDDNS_QueryIP(CWnd* pParent /*=NULL*/)
	: CDialog(CDDNS_QueryIP::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDDNS_QueryIP)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CDDNS_QueryIP::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDDNS_QueryIP)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDDNS_QueryIP, CDialog)
	//{{AFX_MSG_MAP(CDDNS_QueryIP)
	ON_BN_CLICKED(IDC_GO, OnGo)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDDNS_QueryIP message handlers

void CDDNS_QueryIP::OnGo() 
{
	char sOutput[32];
	ZeroMemory(sOutput, 32); //用于输出IP

	CString strIP;
	CString strName;
	
	GetDlgItem(IDC_EDIT_IP)->GetWindowText(strIP);
	int nPort = GetDlgItemInt(IDC_EDIT_PORT);
	GetDlgItem(IDC_EDIT_DEVNAME)->GetWindowText(strName);
	
	BOOL nRet = CLIENT_GetDVRIPByResolveSvr(strIP.GetBuffer(0), nPort, (BYTE *)strName.GetBuffer(0), strName.GetLength(), 0, 0, (char *)sOutput);
	if (!nRet)
	{
		((CNetSDKDemoDlg *)GetParent())->LastError();
		GetDlgItem(IDC_EDIT_OUTPUT)->SetWindowText("failed");
	}
	else
	{
		GetDlgItem(IDC_EDIT_OUTPUT)->SetWindowText(sOutput);
	}
}

BOOL CDDNS_QueryIP::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	g_SetWndStaticText(this);
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -