Script2EXE --- Demonstration - How to Make an ActiveX
Source Codes
function Helo()
{
var dt=new Date;
var hs=dt.getHours();
if(hs>=5 && hs<=12)
return("Good Morning!");
if(hs>12 && hs<=17)
return("Good Afternoon!");
if(hs<=20.00)
return("Good Evening!");
return("Im Sleeping...");
}
function about()
{
return("ActiveX DLL created with Script2EXE");
}
Steps
- Copy the above script source codes to Notepad and save as "helo.js".
- Run Script2EXE.
- Click the [Make ActiveX DLL...] button.
- Locate the saved "helo.js" by clicking the [...] button of the "Source File" group.
- Click the [...] button of the "Output File" group, and name the new ActiveX file, say "helo.dll".
See illustration.
- If you want set your own version info, click the [Version...] button.
- Click [Make], and let Script2EXE register the DLL for you.
Test It!
Save the javascript below and execute it with CScript.exe:
var obj=new ActiveXObject("SHD.Test");
WScript.echo(obj.Helo());