Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

61 lines
1.4 KiB

//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright © 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: LgPortComboBox.cpp
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Source file of LgPortComboBox.cpp
//----------------------------------------------------------------------------
#include "stdafx.h"
#include "SetupCLD.h"
#include "LgPortComboBox.h"
#include "Winspool.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CLgPortComboBox::CLgPortComboBox()
{
}
CLgPortComboBox::~CLgPortComboBox()
{
}
BEGIN_MESSAGE_MAP(CLgPortComboBox, CComboBox)
//{{AFX_MSG_MAP(CLgPortComboBox)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CLgPortComboBox::AutoLoad()
{
// clear all content
CComboBox::ResetContent();
// init new content
DWORD cbNeeded, cReturned;
::EnumPorts(NULL, 1, NULL, 0UL, &cbNeeded, &cReturned);
LPPORT_INFO_1 pPI = (LPPORT_INFO_1)new BYTE[cbNeeded];
if( !pPI )
return FALSE;
BOOL bResult = ::EnumPorts(NULL, 1, (LPBYTE)pPI, cbNeeded, &cbNeeded, &cReturned);
// add port names
for(DWORD i = 0UL; i < cReturned; i++)
AddString( pPI[i].pName );
delete [] (PBYTE)pPI;
return bResult;
}