//加载驱动程序
long result = LoadDRV(); //0成功,
if (result!=0)
MessageBox("加载驱动程序错误");
//检查合法的通道
m_Chanels = CheckValidCh();
m_pLines = new LINESTRUCT[m_Chanels];
SetBusyPara(400);//设置忙音0.40秒
//初始化电话卡的硬件,并为每个通道分配语音缓冲区
EnableCard(m_Chanels,1024*16);
CString convert;
CComboBox* pCombo=(CComboBox*)GetDlgItem(IDC_COMCHANEL);
for (int i = 0; i<m_Chanels; i++)
{
m_pLines.State = CH_FREE; convert.Format("%i",i);
pListCtrl->InsertItem(i,"");
pListCtrl->SetItemText(i,0,convert);
WORD type = CheckChType(i);
m_pLines.nType = type ;
switch(type)
{
case 0: //内线
{
convert = "内线";
break;
}
case 1: //外线
{
pCombo->AddString(convert);
convert = "外线";
break;
}
case 2: //悬空
{
convert = "悬空";
break;
}