24小时热门版块排行榜    

查看: 978  |  回复: 9
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

bianguojun

新虫 (小有名气)

[交流] 【求助】连接两个软件 已有5人参与

用MFC编了个小软件 想和另外一个软件(MFC编)链接起来  比如点下按钮就链接到另一个软件 不知道能不能实现 怎么实现
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

magic7004

金虫 (职业作家)

★ ★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
ajian04(金币+2):谢谢交流~ 2010-11-05 17:43:15
引用回帖:
Originally posted by holmescn at 2010-11-05 11:37:22:
强烈建议使用CreateProcess或者OpenProcess这样的函数,因为你可以对打开的程序有更多的控制权

不需要那么多控制权的时候,就可以用ShellExecute啊。

只是WinExec这个函数不要用了,因为MSDN里有注解:
Note  This function is provided only for compatibility with 16-bit Windows. Applications should use the CreateProcess function.

另外WinExec这个函数不安全:
Security Remarks

The executable name is treated as the first white space-delimited string in lpCmdLine. If the executable or path name has a space in it, there is a risk that a different executable could be run because of the way the function parses spaces. The following example is dangerous because the function will attempt to run "Program.exe", if it exists, instead of "MyApp.exe".

WinExec("C:\\Program Files\\MyApp", ...)

If a malicious user were to create an application called "Program.exe" on a system, any program that incorrectly calls WinExec using the Program Files directory will run this application instead of the intended application.

To avoid this problem, use CreateProcess rather than WinExec. However, if you must use WinExec for legacy reasons, make sure the application name is enclosed in quotation marks as shown in the example below.

WinExec("\"C:\\Program Files\\MyApp.exe\" -L -S", ...)
流氓不可怕,可怕的是流氓有文化,有文化又BH的流氓无敌~~!
10楼2010-11-05 14:31:12
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 10 个回答

magic7004

金虫 (职业作家)

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
ajian04(金币+1):谢谢参与交流~ 2010-11-04 21:55:31
不懂楼主说的“链接”是什么意思
流氓不可怕,可怕的是流氓有文化,有文化又BH的流氓无敌~~!
2楼2010-11-04 16:39:36
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

bianguojun

新虫 (小有名气)

引用回帖:
Originally posted by magic7004 at 2010-11-04 16:39:36:
不懂楼主说的“链接”是什么意思

就在其中一个软件中点下按钮 能打开另外一个软件
3楼2010-11-04 16:51:33
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

holmescn

金虫 (正式写手)

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
ajian04(金币+1):谢谢参与交流~ 2010-11-04 21:55:38
可以用OpenProcess函数. 详查MSDN
4楼2010-11-04 18:24:20
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[博后之家] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +3 k0dTPqJtl0jt 2026-08-14 3/150 2026-08-15 12:41 by KxMI1BYBxWX1
[基金申请] 关于Filecode分析方法 +10 majunge000 2026-08-10 13/650 2026-08-15 12:26 by hanpeng972
[基金申请] 时间戳又变了8-15 +5 archvillain 2026-08-15 9/450 2026-08-15 12:06 by archvillain
[基金申请] 欢迎发来filecode的Mz6后的代码验证其规律 +25 医学老男孩 2026-08-13 52/2600 2026-08-15 11:49 by 大快人心啦
[考博] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +3 HFw0lei2R37i 2026-08-14 5/250 2026-08-15 11:41 by KxMI1BYBxWX1
[考研] 售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急 +5 HFw0lei2R37i 2026-08-14 9/450 2026-08-15 11:33 by KxMI1BYBxWX1
[教师之家] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +5 7lpolszZVXgi 2026-08-14 6/300 2026-08-15 09:28 by sunzitan
[考博] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +4 k0dTPqJtl0jt 2026-08-14 5/250 2026-08-15 04:45 by 4wMiSEwB6436
[考研] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +3 HFw0lei2R37i 2026-08-14 7/350 2026-08-15 00:40 by 4wMiSEwB6436
[基金申请] 咱们一起用铁证分析2026国家社科基金中标与否 +7 启萌科技 2026-08-12 22/1100 2026-08-14 23:45 by Noways
[基金申请] 是这周出结果还是下周出结果? +4 yuleib84 2026-08-11 4/200 2026-08-14 23:05 by lfy8008
[基金申请] 应该是93bebmhtak前后十一个字符比较关键 +23 Lanmanbaby 2026-08-09 37/1850 2026-08-14 13:40 by Equinoxhua
[硕博家园] 读博的好处 +4 lnee 2026-08-11 4/200 2026-08-14 10:20 by ahsoarli
[文学芳草园] 阿姨 +4 汪汪锅 2026-08-09 4/200 2026-08-13 19:43 by arzu_hma
[基金申请] 重要来源:本周末出结果 +10 瞬息宇宙 2026-08-12 10/500 2026-08-13 15:46 by likettle
[基金申请] 分享一下我之前已中青C的计划书的filecode +4 布布和一二 2026-08-11 5/250 2026-08-13 12:56 by cratir
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +11 Tide man 2026-08-11 11/550 2026-08-13 07:35 by 撸猫猫
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[基金申请] 确定了,国自然21号放榜 +6 布布和一二 2026-08-10 7/350 2026-08-10 19:15 by 2000zf36392
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
信息提示
请填处理意见