Internet Explorer ActiveX Batch Quiz Primer Tutorial

Internet Explorer ActiveX Batch Quiz Primer Tutorial

Internet Explorer ActiveX Batch Quiz Primer Tutorial

Hope you don’t find “intellectual exercises” a waste of time? If so, you may need to tune out now, from our HotKey Quiz web application (building on yesterday’s Windows Command Line Batch Quiz Primer Tutorial) discussion below.

There are occasions when old technologies work the (even older) software you create, but modern web browser security issues stop them working now. Examples that just spring to mind are …

  1. some of Flash
  2. lots of Java Applets
  3. ActiveX means of executing Windows executables from webpages

… and today, we are trying the last one, and the reason am still talking “intellectual exercise” is that it worked for us, but is unlikely to work for you, unless, perhaps, you are using …

  • Windows (perhaps old? … have seen it work with recent)
  • Internet Explorer (perhaps old? … have seen it work with recent)
  • ActiveX allowed and enabled
  • Allowed to put executable (DOS batch) into C:\ root directory (ie. you need a hard disk … see what I mean?)

… so, are you still with us as a candidate?

Even if you aren’t, (we proffer) it is interesting to think if you are a candidate and your system is a 32 bit one, and you succeed with today’s HTML hotkey_quiz.html live run link (the coding for which we got great help from this useful link … thanks), that you started on the web talking to a web server here at RJM Programming and your “client” Javascript on that webpage negotiated via ActiveX to call on a DOS Batch file from the C:\ root directory of your hard disk to (if 32 bit) call on Assembler dynamically created to run your HotKey quiz, which we started yesterday with Windows Command Line Batch Quiz Primer Tutorial as shown below. Is this an irony? Will say yes … and add another “irony”, that it is dead easy with Javascript to handle “HotKey” interactive input via keyboard event logic. But if you like “intellectual exercises” am sure you’re way ahead of this “irony” … and now doing the “washing up” … chortle, chortle.


Previous relevant Windows Command Line Batch Quiz Primer Tutorial is shown below.

Windows Command Line Batch Quiz Primer Tutorial

Windows Command Line Batch Quiz Primer Tutorial

Readers who found Assembler Primer Tutorial interesting may well be interested in today’s tutorial where we construct a simple quiz made up of questions suiting a hotkey answer on the Windows command line, written in DOS (or Windows Command Line) Batch.

Ever since Microsoft Windows XP 64 bit operating system, and on, the Windows Command Line (or DOS) has had available to it the extremely useful command …

CHOICE [/C choices] [/N] [/CS] [/T timeout /D choice] [/M text]

… which allows for fairly sophisticated hotkey interactive input functionality. However, we found on the net a really useful link pointing to some clever DOS Batch code possibilities making use of …

DEBUG [[drive:][path]filename [testfile-parameters]]

… facilitating the writing of assembly code to come to the same hotkey capability CHOICE is capable of … but working for 32 bit … should that be your scenario … cute, huh?!

The other cute thing about today’s DOS Batch is its use of …

ping -n 2 >nul

… to sleep for two seconds at various times.

So if you are on Windows you could download quiz.bat to try it out. It includes the brilliance of Paul Tomasi’s hotkey functionality Assembler …

@rem ========================================
@rem GETKEY.BAT - Written by Paul Tomasi 2010
@rem Waits for keypress. Returns key value
@rem ========================================
echo a
echo mov ah, 08
echo int 21
echo mov ah, 4c
echo int 21
echo rcx
echo 08
echo n
echo w
echo q
goto :eof

To read a bit more about Assembler, and the, now, huge history its “story” spans, keep reading below and through to its links. Another topic of interest, if all this interests you, would no doubt be AutoHotKey.

Previous relevant Assembler Primer Tutorial is shown below.

Assembler Primer Tutorial

Assembler Primer Tutorial

Assembler programming is a very early form of software code, dating back as far as 1954, that sits, in the spectrum of computer language sophistication, between computer machine code and the compiled source codes of modern programming languages (which comparatively read like a story … good luck with Assembler stories … gobbleLITTLELESSgook?!), predating BASIC and FORTRAN. The Wikipedia page about compilers puts this in historical perspective “

The first compiler was written by Grace Hopper, in 1952, for the A-0 programming language. The FORTRAN team led by John Backus at IBM is generally credited as having introduced the first complete compiler in 1957.

” Let’s see some information about Assembler, from Wikipedia, below.

An assembly language is a low-level programming language for a computer, or other programmable device, in which there is a very strong (generally one-to-one) correspondence between the language and the architecture’s machine code instructions. Each assembly language is specific to a particular computer architecture, in contrast to most high-level programming languages, which are generally portable across multiple architectures, but require interpreters or compiling.

Assembly language is converted into executable machine code by a utility program referred to as an assembler; the conversion process is referred to as assembly, or assembling the code.

Assembly language uses a mnemonic to represent each low-level machine operation or opcode. Some opcodes require one or more operands as part of the instruction, and most assemblers can take labels and symbols as operands to represent addresses and constants, instead of hard coding them into the program. Macro assemblers include a macroinstruction facility so that assembly language text can be pre-assigned to a name, and that name can be used to insert the text into other code. Many assemblers offer additional mechanisms to facilitate program development, to control the assembly process, and to aid debugging.

The tutorial shows some simple Assembler code in action for a Hello World program after seeing some slides regarding the install of MASM 32bit compiler of Assembler code. Please take care if you go ahead installing MASM 32bit Assembler compiler, and, as mentioned several times with the install, do not proceed if there are even warning messages from the install, or, pretty obviously, if you do not have 32bit Windows as your operating system.

Link to Assembler information … from Wikipedia from which quote above comes.
Link to MASM32 SDK download website here which installs an Assembler compiler for 32bit Windows.
Link to downloadable Assembler programming source code which is word for word from Outputting Hello World in MASM using WIN32 Functions and rename to test.asm

If this was interesting you may be interested in this too.

If this was interesting you may be interested in this too.

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Operating System, Tutorials and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>