COM/COM+
  Home arrow COM/COM+ arrow Page 3 - COM 101: A Quick Primer
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
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? 
COM/COM+

COM 101: A Quick Primer
By: Neville Mehta
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 44
    2002-07-28

    Table of Contents:
  • COM 101: A Quick Primer
  • Features Of COM
  • Identifying Individual Components
  • Conclusion

  • 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


    COM 101: A Quick Primer - Identifying Individual Components


    (Page 3 of 4 )

    As components are developed and used globally, we have to identify each component uniquely. Now how on earth do you think that this can be done? Well, the Open Software Foundation (OSF) came to the rescue and developed an algorithm that generates a unique identifier called the UUID (Universal Unique Identifier). In COM it's called the GUID (Global Unique Identifier). The GUID is a number, which is assigned to the interface, class or a library.

    We wont get too much into the details of how this algorithm works, but let me tell you the aspects it takes into consideration when its generates that unique identifier:
    • The current date and time
    • The network adapter card address
    • The system clock
    • An automatically incremented counter
    Now each COM object has a unique GUID for itself, but where are all of these GUID’s stored? They are stored in your registry. All COM classes are registered in the HKEY_CLASSES_ROOT\CLSID key. For each CLSID key, you also have a sub key called InProcServer32. The value of this sub key will be the filename of the DLL associated with this respective class. Let me show you a screenshot taken from my registry:

    A screenshot of my registry

    Here is an example. This component is an in-process DLL and has something to do with ICQ I assume. How did I know? Well I just checked the value of the InProcServer32 sub key and came to know which DLL this CLSID is associated with.

    Whenever you create a component it will be in the form of an EXE or a DLL. You would have to register them on the machine you will be using them on. If you're distributing your component it could be a part of the installation procedure done automatically, invisible to the user. You could also do the same manually.

    A DLL (Dynamic Link Library) can be registered using the following command:

    REGSVR32 <DLL NAME>

    An EXE (Executable) can be registered using the following command:

    <EXE NAME> /REGSERVER

    More COM/COM+ Articles
    More By Neville Mehta


     

    COM/COM+ ARTICLES

    - Coming To Grips With COM+
    - COM 101: A Quick Primer






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT