using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
public class C_Test
{
[DllImport("Lowlevel01.dll")]
public static extern int Flaeche(int s32_wert1, int s32_wert2);
}
}
------------------------------------------------------------------------
-
private void button1_Click(object sender, EventArgs e)
{
s32_erg = C_Test.Flaeche(2, 4);
textBox1.Text = Convert.ToString(s32_erg);
}
------------------------------------------------------------------------
-
Der header sieht so
aus--------------------------------------------------
int Flaeche( int s32_wert1, int s32_wert2);
und das *.c file kommt nun---------------------------------------------
#include "Berechnung.h"
int Flaeche(int s32_wert1, int s32_wert2)
{
int s32_flaeche;
s32_flaeche = s32_wert1 * s32_wert2;
return(s32_flaeche);
}
Also, würde mich freuen, wenn ihr mir da weiterhelfen könntet.
Danke und Gruß