activex

Working with “Out” Parameters in JavaScript

China☆狼群 提交于 2019-11-28 12:06:07
I am working with an ActiveX control in Internet Explorer 8 that is to display a save file dialog which let's the user choose a file name and file type (jpg, gif, etc). These values get passed to code and then are used in a different method to save the file. Unfortunately the method that invokes the dialog has no return value, and the file name and file type are passed in as out parameters. The signature of the method (expressed in Visual Basic) looks like this: Public Sub SaveFileDialog( _ ByVal bstrDialogType As Variant, _ ByRef pbstrFileName As String, _ ByRef out_pvType As Long _ ) The two

ActiveX event handlers in an HTA using Javascript

你。 提交于 2019-11-28 11:50:52
In C# I can write event handlers as follows: var wdApp = new Microsoft.Office.Interop.Word.Application(); wdApp.DocumentBeforeSave += (Document doc, ref bool saveAsUI, ref bool cancel) => { //do stuff here }; In VBA/VB6, I can use static event handling: Dim WithEvents wdApp As Word.Application Private Sub wdApp_DocumentBeforeSave(ByVal Doc As Document, SaveAsUI As Boolean, Cancel As Boolean) 'do stuff here End Sub I would prefer to use dynamic event handling. However, in Javascript, even when using static event handling with the syntax described here : var wdApp = new ActiveXObject('Word

Adding #include <boost/thread/mutex.hpp> breaks my ActiveX control?

旧城冷巷雨未停 提交于 2019-11-28 11:26:27
Is there a known problem with the boost::mutex header when used inside an ActiveX control? (Boost version v1.39) If I create an MFC ActiveX Control project in Visual Studio 2008 called "DefaultOCXControl" then I can build it, the control registers itself as part of the build, and can be inserted into the ActiveX Test Container as you would expect. All good. If I then just add this line: #include <boost/thread/mutex.hpp> at the top of my DefaultOCXControlCtrl.h file and rebuild: the registration step at the end of the build fails with: Debug Assertion Failed! Program: C:\Windows\system32

How can I use JScript to create a shortcut that uses “Run as Administrator”

倖福魔咒の 提交于 2019-11-28 11:25:54
I have a JScript script that runs using cscript.exe . It creates a shortcut on the desktop (and in the start menu) that runs cscript.exe with parameters to run another JScript script. It looks, in relevant part, like this: function create_shortcut_at(folder, target_script_folder) { var shell = new ActiveXObject("WScript.Shell"); var shortcut = shell.CreateShortcut(folder + "\\Run The Script.lnk"); shortcut.TargetPath = "cscript"; shortcut.Arguments = "\""+target_script_folder+"\\script.js\" /aParam /orTwo"; shortcut.IconLocation = target_script_folder+"\\icon.ico"; shortcut.Save(); } It gets

Place a command button in a cell MS Excel vba

对着背影说爱祢 提交于 2019-11-28 10:22:55
I want to place a command button in a cell though VBA code. Say position B3. I used macro recorder for this purpose but it gives me the top bottom values of the button. I don't want that cuz if I take my code to some other computer with another screen resolution, the code will fail. A cell position (example B3) will be an absolute position. Can you suggest me a way to do this. P.S Its an activeX button Thanks Tim Williams You can't place any object "in" a cell, only over it. You can set the button's Left and Top properties to the Cell's Left/Top. Sub Tester() Dim rng As Range Set rng =

Calling a .dll function from a html page that runs on chrome and firefox

依然范特西╮ 提交于 2019-11-28 09:28:50
I have a dll written in c++. now i need to call the functions in the dll from a html page. I have done this by calling the dll in vbscript (Activex) so that i can run the only in IE. Now i need to run this on Chrome as well as Firefox. What i have to do, whether i have to write in javascript simply or need to develop any extensions for that ? can anyone give a solution with a simple demo for this? Thanks in advance. You have no chance until you create non-portable extension for all browsers. Firefox allows you to create XPI extension aka "addon" Chrome has extensions There is no cross platform

Using ActiveX to get username

我只是一个虾纸丫 提交于 2019-11-28 09:28:19
问题 I'm working with an old intranet site written in classic ASP. I'm trying to retrieve their username they logged into their machine with. Each user is logged into AD, but I can't retrieve it from the server since the intranet site does not use AD. I was told I could use ActiveX in order to retrieve it. I did some research and I found the following code (javascript): var wshshell = new ActiveXObject("WScript.shell"); var username = wshshell.ExpandEnvironmentalStrings("%username%"); Currently I

32 bit ActiveX Control in a 64 bit .NET App

感情迁移 提交于 2019-11-28 08:50:14
问题 I'm creating a C#.Net application which I want to be able to compile for "All CPUs". I also want to include a specific ActiveX control in the UI of this app, but the ActiveX control I'm trying to use does not support 32 bit. Is there some trick or work around I can use to use get this control to work? What about embedding the ActiveX control in a Web-browser control? Would this even work? 回答1: You have to run the ActiveX control in a separate 32-bit process. That's going to be difficult, it

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

旧街凉风 提交于 2019-11-28 08:24:08
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 "Automation server can't create object", I googled it many times, but the IE security things I have

How to create, save a txt file with javascript compatible cross-browser

柔情痞子 提交于 2019-11-28 08:23:11
问题 Do you know any cross-browser method to create and save a file with javacript in client-side?! Considerations: Can't save it in server because the file is going to be read from a fiscal printer. The server can't access the client, this is obvious because we are talking about a web application in the web. So the server can't access a client folder. new ActiveXObject("Scripting.FileSystemObject"); is ONLY for IE and even in the IE not for all versions. We are talking about printing on fiscal