activex

ActiveXObject creation error “ Automation server can't create object”

人走茶凉 提交于 2019-11-27 02:18:51
问题 I have a very simple javascript code, <script language="javascript"> function RunExe() { w = new ActiveXObject("WScript.Shell"); w.run('notepad.exe'); return true; } </script> <form id="form1"> <div> <input type="button" value="Run" onclick="return RunExe()" /> </div> </form> Which create an activeX object to run notepad.exe, if I save this in a plain html and run it in the IE, it works fine opening up the notepad, but if I insert this into a aspx page and run it, it will give an error called

ActiveX control without a form

风格不统一 提交于 2019-11-27 02:09:16
问题 We are required to use a 3rd party ActiveX control. The only issue is, the layer in our software is a business layer and has no access to a window or form. It also runs on separate threads (and should work from any thread) that are not STA. Rather than breaking our separation of UI from business logic, we used this workaround to make it work: Thread thread = new Thread((ThreadStart) delegate { _myActiveX = new MyActiveXType(); _myActiveX.CreateControl(); //more initialize work Application.Run

Create Windows Session programmatically from Console or Windows Service

戏子无情 提交于 2019-11-26 23:35:18
问题 How can I programmatically log in to windows to create a Windows Logon Session? I need a way that works from a WinForms app, from a Console app, and (most important) from a Windows Service. One other requirement is that I need it to work on a the local system that the program/service is running on and also for remote systems. If there's a way to do this using pInvoke/Win32 API I am open to that too. I found these similar questions/answers in my research: Programmatically create and launch and

When do I need to call CoInitialize() in this scenario?

一曲冷凌霜 提交于 2019-11-26 23:22:58
问题 I'm building a multi-threaded windows service application in Delphi XE2 which uses ADO database components to connect to SQL Server. I've used CoInitialize(nil); plenty times before inside threads, but in this case, I have a function which I'm unsure about. This function is called TryConnect which attempts to connect to a database with a given connection string. It returns true or false on the connection success. The problem is that this function will be used both inside and outside the main

Error: ActiveX Component Can't Create Object Scripting.FileSystemObject

时光怂恿深爱的人放手 提交于 2019-11-26 23:15:50
问题 I have a simple vbs-file on my drive c: with following content: Set objShell = CreateObject("Scripting.FileSystemObject") When I'm trying to launch it, I get error c:\fso.vbs(1, 1) Microsoft VBScript runtime error: ActiveX component can't create object: 'Scripting.FileSystemObject' I tried to login as admin and execute wscript -regserver , but didn't help. Can someone help me please? 回答1: Assuming you are logged in as Admin, please have a look in registry for Scripting.FileSystemObject under

Using a WScript.shell activeX to execute a command line

为君一笑 提交于 2019-11-26 22:59:28
问题 I am working on calling a .exe file with a WScript.shell activeX. The file is wkhtmltopdf.exe and it is used to convert a HTML page to a .pdf. Everything is working well when I am just calling C:\wkhtmltopdf.exe in the code. It runs and then closes correctly. But my issue is you need to run it from cmd with the program name then the HTML file name you are reading followed by the .pdf name you want it to be created as. For example: c:\wkhtmltopdf.exe c:\PDFTestPage.html c:\TEST.pdf This will

How to handle an ActiveX event in Javascript

不羁岁月 提交于 2019-11-26 22:11:49
This is somewhat of a follow-up to an answer here . I have a custom ActiveX control that is raising an event ("ReceiveMessage" with a "msg" parameter) that needs to be handled by Javascript in the web browser. Historically we've been able to use the following IE-only syntax to accomplish this on different projects: function MyControl::ReceiveMessage(msg) { alert(msg); } However, when inside a layout in which the control is buried, the Javascript cannot find the control. Specifically, if we put this into a plain HTML page it works fine, but if we put it into an ASPX page wrapped by the <Form>

How do I detect if ActiveX is enabled in the browser of client?

穿精又带淫゛_ 提交于 2019-11-26 21:10:17
问题 How do I detect if ActiveX is enabled in the browser of client? I tried following code, but it's not working in Firefox. window.ActiveXObject not working in Firefox any ideas? check the example here: http://jsfiddle.net/qXSvQ/2/ I get false when I run this example. 回答1: ActiveX objects do not exist in anything but Internet Explorer. If you're trying to use them for XMLHTTPRequests, use the XMLHTTPRequest() object instead, using feature detection. if ("ActiveXObject" in window) { /* Do ActiveX

Overview of differences between Form Controls and ActiveX Controls in Excel

杀马特。学长 韩版系。学妹 提交于 2019-11-26 20:48:44
Why are there 2 types of controls available in Excel? (2 buttons, 2 combo boxes, 2 check box, etc...) What's the difference between Forms Controls and ActiveX Controls ? Which one should I use? Some code samples I find online work with my controls, but others do not. How come? How do I work with each type, and how can I tell the difference? There is [eternal] confusion surrounding the two types of controls available to Excel — exacerbated by the contrasting terminology used by different online sources. This is only a general overview of the differences between Form Controls and ActiveX

Blocking dialogs in .NET WebBrowser control

给你一囗甜甜゛ 提交于 2019-11-26 20:17:37
I have a .NET 2.0 WebBrowser control used to navigate some pages with no user interaction (don't ask...long story). Because of the user-less nature of this application, I have set the WebBrowser control's ScriptErrorsSuppressed property to true, which the documentation included with VS 2005 states will [...]"hide all its dialog boxes that originate from the underlying ActiveX control, not just script errors." The MSDN article doesn't mention this, however. I have managed to cancel the NewWindow event, which prevents popups, so that's taken care of. Anyone have any experience using one of these