如何用程序启动一个拨号连结?

eastsun 2004-09-14 09:30:46

如何用程序启动一个拨号连结?

又如何得到连结已经成功或者失败的消息?

如何结束这个拨号连结。
...全文
122 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
kugou123 2004-09-21
  • 打赏
  • 举报
回复
MSDN资料如下:(取自MSDN2003)

DWORD RasDial(
LPRASDIALEXTENSIONS lpRasDialExtensions,
LPCTSTR lpszPhonebook,
LPRASDIALPARAMS lpRasDialParams,
DWORD dwNotifierType,
LPVOID lpvNotifier,
LPHRASCONN lphRasConn
);

Parameters
lpRasDialExtensions
[in] Pointer to a RASDIALEXTENSIONS structure that specifies a set of RasDial extended features to enable. Set this parameter to NULL if there is not a need to enable these features.

Windows Me/98/95: This parameter is ignored. On these platforms, RasDial always uses the default behaviors for the RASDIALEXTENSIONS options.


lpszPhonebook
[in] Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.

Windows 95: This parameter should always be NULL. Dial-up networking stores phone-book entries in the registry rather than in a phone-book file.


lpRasDialParams
[in] Pointer to a RASDIALPARAMS structure that specifies calling parameters for the RAS connection. Use the RasGetEntryDialParams function to retrieve a copy of this structure for a particular phone-book entry.
The caller must set the RASDIALPARAMS structure's dwSize member to sizeof(RASDIALPARAMS) to identify the version of the structure being passed.

If the szPhoneNumber member of the RASDIALPARAMS structure is an empty string, RasDial uses the phone number stored in the phone-book entry.

dwNotifierType
[in] Specifies the nature of the lpvNotifier parameter. If lpvNotifier is NULL, dwNotifierType is ignored. If lpvNotifier is not NULL, set dwNotifierType to one of the following values. Value Meaning
DWORD The lpvNotifier parameter is a handle to a window to receive progress notification messages. In a progress notification message, wParam is the equivalent of the rasconnstate parameter of RasDialFunc and RasDialFunc1, and lParam is the equivalent of the dwError parameter of RasDialFunc and RasDialFunc1.
The progress notification message uses a system registered message code. You can obtain the value of this message code as follows:

{UINT unMsg =
RegisterWindowMessageA( RASDIALEVENT );
if (unMsg == 0)
unMsg = WM_RASDIALEVENT;
}

0 The lpvNotifier parameter points to a RasDialFunc callback function.
1 The lpvNotifier parameter points to a RasDialFunc1 callback function.
2 The lpvNotifier parameter points to a RasDialFunc2 callback function.

Windows Me/98/95: This value is not supported.



lpvNotifier
[in] Specifies a window handle or a RasDialFunc, RasDialFunc1, or RasDialFunc2 callback function to receive RasDial event notifications. The dwNotifierType parameter specifies the nature of lpvNotifier. Please refer to its description preceding for further detail.
If this parameter is not NULL, RasDial sends the window a message, or calls the callback function, for each RasDial event. Additionally, the RasDial call operates asynchronously: RasDial returns immediately, before the connection is established, and communicates its progress via the window or callback function.

If lpvNotifier is NULL, the RasDial call operates synchronously: RasDial does not return until the connection attempt has completed successfully or failed.

If lpvNotifier is not NULL, notifications to the window or callback function can occur at any time after the initial call to RasDial. Notifications end when one of the following events occurs:


The connection is established. In other words, the RAS connection state is RASCS_Connected.
The connection fails. In other words, dwError is nonzero.
RasHangUp is called on the connection.
The callback notifications are made in the context of a thread captured during the initial call to RasDial.

lphRasConn
[in] Pointer to a variable of type HRASCONN. Set the HRASCONN variable to NULL before calling RasDial. If RasDial succeeds, it stores a handle to the RAS connection into *lphRasConn.
Return Values
If the function succeeds, the immediate return value is zero. In addition, the function stores a handle to the RAS connection into the variable pointed to by lphRasConn.

If the function fails, the immediate return value is a nonzero error value, either from the set listed in the RasError.h header file or ERROR_NOT_ENOUGH_MEMORY.

tjandy 2004-09-21
  • 打赏
  • 举报
回复
楼主你代码帖出来,大家帮你看看,你光说,这样错误很难解决的
tjandy 2004-09-15
  • 打赏
  • 举报
回复
ras可以为你做到,相关资料楼主可以上网查一下
DentistryDoctor 2004-09-15
  • 打赏
  • 举报
回复
直接RasDial函数。
eastsun 2004-09-15
  • 打赏
  • 举报
回复

我的系统环境是win2000 专业版。
eastsun 2004-09-15
  • 打赏
  • 举报
回复

我找到了一个程序,可是 DWORD ret=RasEnumEntries(NULL,NULL,NULL,&dwSize,&n);

ret返回值也是632,这个广泛流行的程序,应该不会有这么奇怪的错误。

真的不知道哪个地方配置不对劲了。

steven_sina 2004-09-14
  • 打赏
  • 举报
回复
同意楼上
Kudeet 2004-09-14
  • 打赏
  • 举报
回复
其中“连接Internet”为你创建的拨号程序名称
winexec('rundll32.exe rnaui.dll,RnaDial '+'连接Internet',9);
eastsun 2004-09-14
  • 打赏
  • 举报
回复

up.
计算机专业学生毕业实习工作报告 计算机毕业实习报告 ( 一) 跟着计算机技术的飞快发展, 计算机在公司管理中应用的普及,各个行业都在踊跃使用现代化的手段, 利用计算机实现公司人事、 薪资、资料、财务等方面的管理势在必行,这些都在很大程度上给公司提出 愈来愈严重的挑战, 对公司系统不论是内行政职能、 公司管理水平以及优良服务上都提出更高的要求。 太原市华瑞电子科技有限公司是从事有线电视、环境与动力系统 动向智能监控、工业监控、地区智能安全防备及家居安防报警、计算机网络 与信息传输等系统工程的专业公司。 在日趋强烈的商业市场上,公司不单着力于在工程质量、服务质量上求胜, 并且在公司内部实现局域网络的联接,以提升办公效率,资源信息化。所以 ,公司将 多台计算机连结起来构成了一个局域网, 实现了文件传输,文件共享,程序共享,资源共享,打印共享, inter 共享等,进而享受网络所带来的迅速、便利。 公司将多台计算机互连经过宽带共同上网, 采纳的是星型构造,主机 ( 即直接与宽带网连结的电脑 ) 安装双网卡,此中网卡 A 用来经过宽带接入 Inter ,网卡 B和集线器 (Hub) 相连结,与其余电脑 ( 从机 ) 构成局域网。其余电脑各安装一个网卡,并与集线器相连,经过共享 主机的宽带连结来接入 Inter 。第一在 WindowsXP下进入"开始 控 制面板 网络和 Inter 连结 网络连结",你会看到两块网卡的图标。 双击接入宽带的网卡进入其"属性"框,选" QoSPacketcheduler " 和"TCP/IP"即可。其次设置局域网参数。双击网卡符号,依据需要 安装" Clientformicrosoftetworks ", "QoSPacketcheduler "和"TCP/IP"等等一些协议。而后双击框里 Interrotocol(TCP/IP) 协议进入其属性设置, IP 地点设为 192.168.0.1 ,子网掩码设为 即可。因为 WindowsXP自带 PPPoE拨号和网关软件, 所以我们不用再安装其余软件。 进入"控制面板 网络和 Inter 连结 网络连结",点击左侧的"创立一个新的连结",选择"新建连结导游 连 结到 Inter 手动设置我的连结",接下来挨次填写"连结名称"、"用户"、"密码"最后点 击"达成"。而后双击就能够接 入 Inter 了。各项设置所有达成,翻开"网上街坊"看到一个工作组中其余电脑表记, 那么一个局域网络就形成了, 使计算机发挥其作用,提升工作效率,或许能够迅速便利的获取各样信息。 以上的网络中主要波及到硬件物理链接和网络设置双方面。我公 司的物理链接主要采纳了双绞线连结,因其价钱便宜、性 能优秀、连结靠谱、保护简单,是公司局域网络布线时最好的选择。当前, 使用最宽泛的双绞线是非障蔽五类双绞线 (UTP),带宽可至 100Mbps,计算机与计算机间的连结经过集线设施来实现。在网络设 置上,第一、在一台电脑上先装好 ADSL,而后做好平等网,把 IP 地 址的设置要正确,实此刻网络街坊中能互访。第二、在主机的控制面 板中,选择"增添 / 删除程序",而后在" WINDOWS安装程序"选项 卡中选择"Inter 工具"-->"详尽资料"---> 选中"Inter 连结共享", 而后按确立,依据屏幕提示就能够为系统安装 Inter 连结共享。这样 实现了小型局域网的最正确组网,只有一个花费,大家共享。 此外,波及到配置协议的话, 我就有必需说明一下 TCP/IP 协议 了, TCP/IP 协议应用于各样种类的以太网中和广域网中,实现不同 种类的网络以及不同种类的操作系统主机间的互相通讯。 IP 地点包 括两个部分,即网络部分和主机 ( 或节点 ) 部分。 IP 地点被区分为三 "类",即 A 类、 B 类和 C类。公司网络一般采纳 C类网段地点。首 先,安装 TCP/IP 协议。在控制面板 网络 配置选项卡中单击"添 加"按钮,从列表框中选中"协议"后再次单击"增添"按钮,而后 在"厂商"列表框中选中" Microsoft ",在"网络协议"列表框中 选中" TCP/IP",单击"确立"按钮从头启动计算机以便使新的设置 奏效。其次,指定 IP 地点。在控制面板 网络 配置选项卡中选中 与安装的网卡绑定在一同的 TCP/IP 议,单击"属性"按钮,在 IP 地 址选项卡中选中"指定 IP 地点"选项,而后键入为该主机分派的 IP 地点和子网掩码。设置完成,可使用 Ping 命令来测试设施间的连通 性。可是,任意两台计算机或集线设施的 IP 地点都不该同样,不然 会产生 IP 地点矛盾而不可以进行通讯。局域网内的所有的计算机的网 络号应该同样, 不然会因为不处于同一网络而相互不可以接见。 主
是一款相当方便使用的离线浏览工具,可排定抓取时间、设定Proxy,也可选择抓取的项目及大小,可自设下载的存放位置、及存放的空间限制。它内置浏览程序、可直接浏览或是使用自己喜欢的浏览器来浏览、且更可直接以全浏览窗切换来作网上浏览,另它对于抓取的网站更有MAP的提供、可更清楚整个网站的连结及目录结构。 MetaProducts Offline Explorer Enterprise 中文多语特别版MetaProducts Offline Explorer Enterprise 中文多语特别版 下载的网站很容易出口到要求的格式的另一个位置或添加到MS IE缓存,邮政编码,searcheable的HTML帮助(CHM),MHT文件或压缩的EXE文件查看器 内置备份/恢复项目(www.dayanzai.me) 通过下载的文件搜索关键字的文件名或HTML文本 多个项目选择允许在项目树的快速操作 内置拨号与能力断开或关闭电脑自动下载完成时 灵活的URL过滤器具有强大的关键字支持微调您的下载 下载速度控制 下载可以预定,测序或通过命令行启动 在项目树的嵌套的文件夹 网址宏 在每一个项目中的多个网址 能够保持加载的文件的旧副本 下载队列管理器 数据挖掘 – 下载网站后处理 其他服务器的链接层次功能 自动导出下载项目 自定义引荐,饼干和POST请求 导出下载网站没有子目录普通的目录或上传使用FTP 其它项目描述窗口,(www.dayanzai.me)提供多行注释 MetaProducts Offline Explorer Enterprise Easy Wheel™ 技术。你不需要点击控件使用鼠标滚轮来滚动它。只需将鼠标置于要向上或向下滚动并使用滚轮控制!

16,471

社区成员

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

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

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