[英]How to use IPC to pass data from ActiveX Object into a VB6 application - (Single instance application)?
I have created an ActiveX dll (object). 我创建了一个ActiveX dll(对象)。 I am calling the object from JavaScript in the IE browser.
我正在IE浏览器中从JavaScript调用对象。 The object has a method named "run" which launches a VB6 application and passes a parameter to it.
该对象具有一个名为“ run”的方法,该方法启动VB6应用程序并将参数传递给它。 To create the ActiveX object I have referred to this link .
为了创建ActiveX对象,我已经引用了此链接 。
I am calling this script on click of URL in browser. 我在浏览器中单击URL时会调用此脚本。 The problem is that onclick the URL a new application launches every time.
问题在于onclick URL每次都会启动一个新应用程序。 Instead, I would like to use IPC (inter process communication) so that I can check via JavaScript if the application is already launched and pass the parameter to it using IPC (else launch and pass parameter to it).
相反,我想使用IPC(进程间通信),以便可以通过JavaScript检查应用程序是否已启动,并使用IPC将参数传递给它(否则将启动并传递参数给它)。 The VB6 app will then need to be programmed in such a way that it is capable of accepting parameters.
然后将需要以能够接受参数的方式对VB6应用进行编程。 Instead of IPC is there any other method for messaging?
除了IPC,还有其他消息传递方法吗?
Please can you guide me on this topic.. or provide with some reference articles/links/code samples 请您为我提供有关此主题的指导。或提供一些参考文章/链接/代码示例
Here is the answer:- http://www.hanselman.com/blog/TheWeeklySourceCode31SingleInstanceWinFormsAndMicrosoftVisualBasicdll.aspx 答案是:-http: //www.hanselman.com/blog/TheWeeklySourceCode31SingleInstanceWinFormsAndMicrosoftVisualBasicdll.aspx
It contains a program which passes txt file path to the application via command line and the application opens up and loads the file contents. 它包含一个程序,该程序通过命令行将txt文件路径传递给应用程序,并且该应用程序打开并加载文件内容。 Upon running the app via command line for 2nd time using another filename as parameter, the file contents are shown in the same instance of the application.
使用另一个文件名作为参数通过命令行第二次运行该应用程序时,文件内容显示在该应用程序的同一实例中。 Cool!
凉!
However, this code is not VB6 但是,此代码不是VB6
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.