Home  >  Article  >  Backend Development  >  请问在php中如何调用MFC的activeX控件?我在html里可以调用但在.php网页里就不能调用了

请问在php中如何调用MFC的activeX控件?我在html里可以调用但在.php网页里就不能调用了

WBOY
WBOYOriginal
2016-06-23 14:11:151206browse

<!doctype html><html lang="en"><head>	<meta charset="UTF-8">	<title>Document</title>			<script type="text/javascript">		function func(localuser,remotecomputer)		{			var direfilename = localuser + remotecomputer + ".txt";			var command = "-directory z:\\"+direfilename;			myobj.run(command);			//myobj.run(arg);			//myobj.xxxxx();		}	</script></head><body>	<div style="display:none;"> <OBJECT id="myobj" classid="CLSID:895B917E-885A-4DA0-BF89-12A03C205AB7"></OBJECT> </div>	<a onclick="func('tom','127.0.0.1');">test</a></body></html>


上面这个代码是我做完控件并且注册后写的html例子,保存成XXX.html后测试也是成功的。但是如果把这个文件保存成XXX.php插件就会有问题(均放在apache中测试)。请问怎么才能在.php的文件中像这样调用activeX控件??


回复讨论(解决方案)

刚搜了下,好像php要按下面这么写,但我试了下还是不行。

<?	//include("D:\HPActiveX.ocx");	//$myobj = new COM("{895B917E-885A-4DA0-BF89-12A03C205AB7}") or die("error");	$myobj = new COM("HPActiveX.CHPActiveXCtrl") or die ("error");	$myobj->run("-directory z:\\t0m127.0.0.1");?>

谁能帮忙解释解释到底应该怎么弄?

MFC,富文本框吗,要加这个插件好像

MFC,富文本框吗,要加这个插件好像
不是的,环境问题,配下环境就好了,分给你吧。谢谢

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP SQL 中文乱码Next article:为什么用 get