Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I integrate compiled .NET code with QuickMacros?
#3
And this is with two methods and two properties.

When compiling C#, exit QM, because the type library is locked by QM.

Code:
Copy      Help
using System;

namespace ClassLibrary2
{
    public interface IArithmetic
    {
        int AddIntegers(int a, int b);
        string AddStrings(string a, string b);

        int Prop1
        {
            get;
            set;
        }

        string Prop2
        {
            get;
        }
    }

    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    public class Arithmetic :IArithmetic
    {
        int m_prop1;
        string m_prop2;

        public Arithmetic()
        {
            //
            // TODO: Add constructor logic here
            //
            m_prop1=0;
            m_prop2="aaaaaaa";
        }

        #region IArithmetic Members

        public int AddIntegers(int a, int b)
        {
            // TODO:  Add Arithmetic.AddIntegers implementation
            return a+b;
        }

        public string AddStrings(string a, string b)
        {
            return a+b;
        }

        public int Prop1
        {
            get
            {
                return m_prop1;
            }
            set
            {
                m_prop1=value;
            }
        }

        public string Prop2
        {
            get
            {
                return m_prop2;
            }
        }

        #endregion

    }
}

Code:
Copy      Help
typelib ClassLibrary2 "C:\Documents and Settings\G\Desktop\ClassLibrary2\bin\Debug\ClassLibrary2.tlb"
ClassLibrary2.IArithmetic i._create(uuidof(ClassLibrary2.Arithmetic))

out i.AddIntegers(2 4)

out i.AddStrings("Q" "M")

i.Prop1=5
out i.Prop1

out i.Prop2


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)