Einzelnen Beitrag anzeigen

winx

Registriert seit: 14. Jun 2005
265 Beiträge
 
#1

C#.Net2.0 DLL in Delphi2007 nutzen (Com)?

  Alt 13. Feb 2008, 10:30
Hallo,

habe eine Assembly die ich nun unter Delphi nutzen möchte.

Ich habe die Klassen wie folgt aufgebaut:

Code:
    [ComVisible(true)]
    public class DotNetClass
    {
        /// <summary>
        /// Der Int Wert der Klasse
        /// </summary>
        private int m_ValueInt = 0;

        /// <summary>
        /// Der String der Klasse
        /// </summary>
        private readonly string m_ValueString = String.Empty;

        /// <summary>
        /// Das utilitiy Objekt
        /// </summary>
        private Utility m_Util = new Utility();

       
        /// <summary>
        /// Standardkonstruktor
        /// </summary>
        public DotNetClass()
        {
            m_ValueString = "Hallo";
            m_ValueInt = 7;
            m_Util = new Utility();

        }
...

Die AssmeblyInfo.cs sieht so aus:
Code:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DotNetDLL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("NWL Lasertechnologie ")]
[assembly: AssemblyProduct("DotNetDLL")]
[assembly: AssemblyCopyright("Copyright © NWL Lasertechnologie 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fc0e9806-4758-482d-b677-d11598f1cd3c")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Nun möchte ich das gerne in Delphi einbinden und das klappt auch.

Nur sehe ich nur die Klassen, aber keine Properties und Funktionen...

Wo liegt noch mein Fehler?

Danke,
winx
  Mit Zitat antworten Zitat