Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. ComClass in C#

ComClass in C#

Scheduled Pinned Locked Moved C#
csharphelplinqcomsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Saranya B
    wrote on last edited by
    #1

    Hello Everybody, How can we create a class using ComClass Template. First of all, I am not able to add the reference of Microsoft.Build.Tasks.V3.5 since it is not being listed out in the Add Reference dialog. So I browsed this dll and added the reference. Still my problem is not solved. I am getting the following error. 'Microsoft.Build.Tasks.Deployment.ManifestUtilities.ComClass' is not an attribute class I am not sure. Here is my code,

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Build.Tasks.Deployment.ManifestUtilities;

    namespace COMArray
    {
    [ComClass(ComClass2.ClassId, ComClass2.InterfaceId, ComClass2.EventsId)]

    public class ComClass2
    {
        
    
        #region "COM GUIDs"
        // These GUIDs provide the COM identity for this class 
        // and its COM interfaces. If you change them, existing 
        // clients will no longer be able to access the class. 
        public const string ClassId = "83a8275f-9282-4257-ba62-afab6ed03beb";
        public const string InterfaceId = "e75a1569-f1aa-4bdc-8e39-ae5807ee5baa";
        public const string EventsId = "f966bdd3-9c5b-4ad9-8714-bc17d28f7e3a";
        #endregion
    
        // A creatable COM class must have a Public Sub New() 
        // with no parameters, otherwise, the class will not be 
        // registered in the COM registry and cannot be created 
        // via CreateObject. 
        public ComClass2()
            : base()
        {
        }
    
        private int \_test;
        public int test
        {
            get { return \_test; }
            set { \_test = value; }
        }
    
    }
    

    [ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)]
    public class ComClass1
    {

        #region "COM GUIDs"
        // These GUIDs provide the COM identity for this class 
        // and its COM interfaces. If you change them, existing 
        // clients will no longer be able to access the class. 
        public const string ClassId = "35cf06df-5ed3-431f-9780-1e30d8acb94c";
        public const string InterfaceId = "04fcc0fb-da33-4750-bab1-86e3b6d0e300";
        public const string EventsId = "e073bca9-3bc5-437a-8c77-a489086c6517";
        #endregion
    
        // A creatable COM class must have a Public Sub New() 
        // with no parameters, otherwise, the class will not be 
        // registered in the COM registry and cannot be created 
        // via CreateObject. 
        public Com
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups