bsp; Error=lineMakeCall(myhLine,&myhCall,"8880751",0,?);
If(Error!=0)
{ sprintf(buf,"%lx",Error);
MessageBox(buf,0,MB_OK); }
}
}
}
---- 5 呼 叫 方 回 调 函 数 的 定 义
void far pascal TMyDecFrame::lpfnCallback
(DWORD hDevice, DWORD dwMsg,
DWORD dwCallbackInstance,
DWORD dwParam1, DWORD dwParam2,
DWORD dwParam3)//
参数定义同lineCallbackFunc函数中的参数定义
{ int Rec_num=0;
switch(dwParam1)
{ case LINECALLSTATE_CONNECTED:
DWORD len;
ClearCommError(myhModem,&Error,&Status);
Rec_num=Status.cbInQue;
ReadFile(myhModem,RecBuf,Rec_num,&len,0);
//至此已经为数据通信做好了前期准备,可设立标志
WriteFile(myhModem,"Success",7,&len,0);
ReadFile(myhModem,RecBuf,8,&len,0);
pwin->MessageBox(RecBuf,0,MB_OK);
break;
case LINECALLSTATE_IDLE:
lineDeallocateCall(myhCall);
break;
case LINECALLSTATE_DISCONNECTED:
lineClose(myhLine);
lineShutDown(myhTapi);
break;
}
}
---- 6 被 叫 方 回 调 函 数 的 定 义
void far pascal TMyDecFrame::lpfnCallback(DWORD hDevice, DWORD dwMsg,
DWORD dwCallbackInstance, DWORD dwParam1, DWORD dwParam2,
DWORD dwParam3)
{ int Rec_num=0;
switch(dwParam3)
{ case LINECALLPRIVILEGE_OWNER:
myhCall=(HCALL)hDevice;
Break;
}//只有对呼叫具有私有特权的调用者才能应答呼叫,
在此获得呼叫句柄
switch(dwParam1)
{ case LINECALLSTATE_CONNECTED:
DWORD len;
ClearCommError(myhModem,&Error,&Status);
Rec_num=ComS.cbInQue;