We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


How do I create a DLL to interface with JavaScript

4fingers asked
Medium Priority
Last Modified: 2012-06-27
I am new to DLL development so I followed the following tutorial on how I can create a COM DLL along with a Win32 application that calls its functions:
The Simplest COM Tutorial in Visual Studio 2008

This all worked as expected but my ultimate goal is to run the DLL from a scripting interface like JavaScript e.g.
try {
    var app = new ActiveXObject("SimpleCOM.SimpleChatServer.1");
    app.CallMe("Test 1","Test 2");
catch (e) {
    alert("Error: " +e.message);

Open in new window

The following example just returns the following error message:
"Error: 'app' is null or not an object"

I am also aware that the DLL needs to be registered which Visual Studio 2008 seems to do automatically. Using RegDllView I was able to see the DLL listed (Sorry for the lack of formatting)
Class ID       Name       ProgID       Control       Version       Threading Model       Last Write Time
{3C32480D-2799-41EC-8E9F-6CBFFC20D51B}      SimpleChatServer Class      SimpleCOM.SimpleChatServer.1      No             Apartment      19/04/2011 19:42:12

Does any one know what further steps are required so it can start interfacing with it via JavaScript e.g. allowing me to call setters and getters from within the DLL file.

Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)

for a brief introduction to early binding and late binding read here:


I decided to create a new ATL project and I made sure "Support COM+ 1.0" was checked. Then when I came to creating a new class I enssured the "ATL Simple Object Wizard" had the "Interface" set to "Dual".
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.