Code Examples
  Home arrow Code Examples arrow Introducing Custom Objects with WSC
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
CODE EXAMPLES

Introducing Custom Objects with WSC
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-03-23

    Table of Contents:
  • Introducing Custom Objects with WSC
  • Advantages of using custom COM objects
  • What your COM objects can do
  • What a WSC looks like

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introducing Custom Objects with WSC


    (Page 1 of 4 )

    If you’ve been scripting for more than a few minutes, you’ve undoubtedly used some form of COM object in your scripts. These are objects provided by the operating system and other applications that allow you to perform tasks that aren’t provided by the scripting environment. Most of these objects are compile code that resides in a DLL or OCX file somewhere. Most people believe that you have to have some level of advanced programming ability to create these objects for yourself. That’s not the case. Today I’m going to show you how to create custom COM objects using nothing more than the scripting knowledge you already possess.

    The technology we’ll be using is called Windows Script Components—a technology designed specifically to allow programmers to create objects with nothing more than a knowledge of scripting.  The Windows Script Component Technology works with the scripting environment to expose simple scripts as COM-enabled objects.

    The WSC technology was originally known as Scriplets, a means of creating small COM-enabled applications and objects for use in web development.  However, since this technology relies on COM, this isn’t just limited to browser-based development.  It can be utilized by any technology that is capable of working with a COM interface.  As COM gained more and more popularity (and Windows Scripting became more widely used), the Scriptlet technology was expanded into Windows Script Components.

    Creating a Windows Script Component is as easy as creating a text file.  At its most basic level, a WSC is little more than a Windows script wrapped inside of an XML file.  This XML file is used to provide the information necessary for the component to be recognized as a COM object, while the contained script performs the programming magic.

    A WSC is powered by the Windows Script Host environment.  The WSC is (generally) registered on the system as a COM object.  When that object is instantiated, the system points to the WSC file, which is then executed by the Windows Script Host and exposed to the calling application through a generated COM interface.  This is all done seamlessly behind the scenes so that the result is no different from what would have happened if the programmer had used some compiled object.

    More Code Examples Articles
    More By Nilpo


     

    CODE EXAMPLES ARTICLES

    - Bipartite Graphs
    - Connectivity in Graphs
    - The Ford-Fulkerson Algorithm
    - Critical Paths
    - The Bellman-Ford and Roy-Floyd Algorithms
    - Shortest Path Algorithms in Graphs
    - Minimum Spanning Tree
    - Articulation Edges and Vertexes
    - Circles and Connectivity in Graphs
    - Depth-First Search in Graphs
    - Breadth-First Search in Graphs
    - The Prufer Code and the Floyd-Warshall Algor...
    - An Insight into Graphs
    - Coding a Custom Object with WSC
    - Creating a Custom Object with WSC





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek