ADRESSCOMBOBOX.CPP
资源名称:SNMP范例源代码.zip [点击查看]
上传用户:shgx688
上传日期:2009-12-27
资源大小:855k
文件大小:1k
源码类别:
SNMP编程
开发平台:
MultiPlatform
- // AdressComboBox.cpp : implementation file
- //
- #include "stdafx.h"
- #include "oam.h"
- #include "AdressComboBox.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CAdressComboBox
- CAdressComboBox::CAdressComboBox()
- {
- }
- CAdressComboBox::~CAdressComboBox()
- {
- }
- BEGIN_MESSAGE_MAP(CAdressComboBox, CComboBox)
- //{{AFX_MSG_MAP(CAdressComboBox)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CAdressComboBox message handlers
- BOOL CAdressComboBox::AddNewAdress(LPCSTR str)
- {
- int nFound = FindStringExact(-1, str);
- if (nFound == CB_ERR)
- {
- InsertString(0, str);
- SetCurSel(0);
- }
- else
- SetCurSel(nFound);
- /* int nFound = FindStringExact(-1, str);
- if (nFound == CB_ERR)
- {
- COMBOBOXEXITEM item;
- item.mask = CBEIF_TEXT;
- item.iItem = -1;
- item.pszText = (LPTSTR)(LPCTSTR)str;
- int index = InsertItem(&item);
- if(index != -1)
- SetCurSel(index);
- else
- return FALSE;
- }
- else
- SetCurSel(nFound);
- */ return TRUE;
- }