vc高手看过来!如何实现通过程序拨号(专线猫)请给出例子!急.急.急!

silanglangbang 2002-04-03 01:41:23
通过猫的连接!传输数据!只能先设置猫的一些选项再连接!可不可通过程序实现!如果可以请给出例子!谢谢!一定给分!在线等候!
...全文
44 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
Greenwillow 2002-04-03
  • 打赏
  • 举报
回复
发了,发了,没收到再要。
silanglangbang 2002-04-03
  • 打赏
  • 举报
回复
请问还有没有懂得了???????
silanglangbang 2002-04-03
  • 打赏
  • 举报
回复
请问 greenwillow(看看再说) 您给发了么?我没有收到!
silanglangbang 2002-04-03
  • 打赏
  • 举报
回复
请问 greenwillow(看看再说) 您给发了么?我没有收到!
simo 2002-04-03
  • 打赏
  • 举报
回复
to greenwillow(看看再说) :

能不能给我一份啊?

simoli@163.com

咱也谢谢:)
silanglangbang 2002-04-03
  • 打赏
  • 举报
回复
好的!先谢谢了!silang-langbang@163.com
Greenwillow 2002-04-03
  • 打赏
  • 举报
回复
天呀,太长,还是发给你你吧,留下地址得了。
Greenwillow 2002-04-03
  • 打赏
  • 举报
回复
// ***********************************************
// This routine places the actual call
//
LONG CTapiLine::DialCall( LPTSTR PhoneNumber )
{
LONG retcode = 0; // local returns
DWORD i; // counter for lines
DWORD RetApiVersion; // return version
LINEEXTENSIONID ExtensionID; // struc for API call

// Initialize the line, register the callback
if( m_LineHandle == NULL )
{
retcode = ::lineInitialize( &m_LineHandle,
m_hInst,
(LINECALLBACK)lineCallbackFunc,
"SANS TAPI",
&m_dwLines );
if( retcode < 0 )
{
TapiStatus("初始化线路发生错误。" );
return (retcode);
}
else
TapiStatus("初始化线路..." );
}

//
// go through all the lines to get API and properties
// if you find one that has the right properties,
// jump out and continue to next section of code
//
if( m_hLine == NULL )
{
for( i=0; i < m_dwLines; i++ )
{
// Negotiate the API Version for each line
retcode = ::lineNegotiateAPIVersion( m_LineHandle,
i,
EARLY_TAPI_VERSION,
WIN95TAPIVERSION,
&RetApiVersion,
&ExtensionID );

retcode = ::lineOpen( m_LineHandle,
i,
&m_hLine,
RetApiVersion,
0,
(DWORD)m_hInst,//m_hWnd,
LINECALLPRIVILEGE_NONE , //仅仅允许出站呼叫
LINEMEDIAMODE_DATAMODEM,
NULL );
if( retcode == 0 ) break;
}
if( retcode != 0 ) return(ERRORS);
}

// now set of properties of the line for outbound dialing
memset( &m_LineParams, 0, sizeof( LINECALLPARAMS ) );
m_LineParams.dwTotalSize = sizeof( LINECALLPARAMS );
m_LineParams.dwMinRate = 9600; // setting data rates
m_LineParams.dwMaxRate = 57600; //28800; //
m_LineParams.dwBearerMode = LINEBEARERMODE_VOICE; //LINEBEARERMODE_DATA; //
m_LineParams.dwMediaMode = LINEMEDIAMODE_DATAMODEM;

// finally place the call!
retcode = ::lineMakeCall( m_hLine,
&m_hCall,
PhoneNumber,
0,
&m_LineParams );

if( retcode < 0 ) return (retcode);
else Delay(5000); // make a 5 secs delay... or according to ur needs
return( retcode );
}
Greenwillow 2002-04-03
  • 打赏
  • 举报
回复
可以通过TAPI函数来实现,下面是一个有关此操作的类,你看看吧。
// TapiLine.h

#ifndef __MSM_TAPILINE__
#define __MSM_TAPILINE__

// In VC5+ do this.. ok
// To build a TAPI 1.4 application put a define as below in your source
// file before you include TAPI.H:
//
#define TAPI_CURRENT_VERSION 0x00010004

#include <tapi.h>

//
// User defined messages notified by TAPI for Logs maintenence
// Capture them in to ur view class ok.
//

#define TAPI_LINECALLSTATE_CONNECTED WM_USER+500

#define WM_TAPI_DIALING WM_USER+1000
#define WM_TAPI_CONNECT WM_TAPI_DIALING+1
#define WM_TAPI_DISCONNECT WM_TAPI_DIALING+2
#define WM_TAPI_IDLE WM_TAPI_DIALING+3
#define WM_TAPI_STATUS WM_TAPI_DIALING+4
#define WM_TAPI_CALL_PROCEEDING WM_TAPI_DIALING+6
#define WM_TAPI_CALL_ACCEPTED WM_TAPI_DIALING+7
#define WM_TAPI_LINE_REPLY WM_TAPI_DIALING+8
#define WM_TAPI_VOICE_SUPPORT WM_TAPI_DIALING+9

// All TAPI line functions return 0 for SUCCESS, so define it.
#define SUCCESS 0
#define ERRORS -1


// The TAPI versions
#define TAPI_VERSION_1_0 0x00010003
#define TAPI_VERSION_1_4 0x00010004
#define TAPI_VERSION_2_0 0x00020000

// TAPI versions that this sample is designed to use.
#define WIN95TAPIVERSION TAPI_VERSION_1_4
#define EARLY_TAPI_VERSION TAPI_VERSION_1_0


/////////////////////////////////////////////////////////////////////////////
// CTapiLine window

class CTapiLine
{
protected:
static CTapiLine* MyThis;

HWND m_hWnd;
HINSTANCE m_hInst;

HLINEAPP m_LineHandle; // tapi line handle
HCALL m_hCall; // call handle
HLINE m_hLine; // line handle
HANDLE m_hComm; // comm handle
DWORD m_dwLines; // count of available lines/devices
LINECALLPARAMS m_LineParams; // need this structure
DWORD m_dwDevice;

int m_nDevice;
long m_nPrivilege;
long m_nMediaMode;

DWORD m_dwAPIVersion; // the API version
char m_szPhoneNumber[64];// the phone number to call
char m_szMessage[128]; // Tapi reults

// Construction
public:
CTapiLine();

// Attributes
public:

// Operations
protected:
// Overrides
// protected virtual functions
void TapiCallBack( DWORD dwDevice,
DWORD dwMessage,
DWORD dwCallbackInstance,
DWORD dwParam1,
DWORD dwParam2,
DWORD dwParam3 );

protected:
void Delay(UINT lFactor);
LONG LineStateConnected( void );

public:
// Overrides
//
// public virtual functions
//
void Create( HWND hWnd );
LONG DialCall( LPTSTR PhoneNumber );
LONG WaitCall( void );
LONG HangupCall( void );

// Implementation
public:
~CTapiLine();
void TapiStatus( LPSTR lpszError );
LPSTR GetTapiStatus() const
{
return (LPSTR)m_szMessage;
}
// static functions
static void CALLBACK lineCallbackFunc( DWORD dwDevice,
DWORD dwMessage,
DWORD dwCallbackInstance,
DWORD dwParam1,
DWORD dwParam2,
DWORD dwParam3 );
};

#endif // __MSM_TAPILINE__

/////////////////////////////////////////////////////////////////////////////

// TapiLine.cpp : implementation file
//

#include "stdafx.h"
#include "TapiLine.h"

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


// A pointer to my class because TAPI needs a callback
CTapiLine* CTapiLine::MyThis = NULL;


/////////////////////////////////////////////////////////////////////////////
// CTapiLine

CTapiLine::CTapiLine()
{
MyThis = this;
m_LineHandle = NULL;
}

void CTapiLine::Create(HWND hWnd)
{
m_hWnd = hWnd;
m_hInst = (HINSTANCE)::GetWindowLong(m_hWnd, GWL_HINSTANCE);
m_hLine = NULL;
m_hComm = NULL;
m_hCall = NULL;
}


CTapiLine::~CTapiLine()
{
}
silanglangbang 2002-04-03
  • 打赏
  • 举报
回复
希望能给出例子!给分!
qunta 2002-04-03
  • 打赏
  • 举报
回复
RasDial
jsyou 2002-04-03
  • 打赏
  • 举报
回复
关于串口读写的例子已经比比皆是了,AT命令一般在MODEM的手册中都会给出。
silanglangbang 2002-04-03
  • 打赏
  • 举报
回复
jsyou(jsyou)能不能给出个例子!
jsyou 2002-04-03
  • 打赏
  • 举报
回复
通过串口直接给MODEM发AT命令就可以了。

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧