Entwickler-Ecke

Basistechnologien - Zugriff auf lpt Port


blutengel - Mo 27.12.10 23:52
Titel: Zugriff auf lpt Port
Hi!

möchte mit einem Programm etwas auf meinem LPT Port ausgeben. Leider bekomme ich immer eine Fehlermeldung:

Es wurde versucht, eine Datei mit einem falschen Format zu laden. (Ausnahme von HRESULT: 0x8007000B)


C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices; //externe Klassen einbinden

namespace LPT_Test
{
    class Program
    {
        static void Main(string[] args)
        {
            LptAccess.Output(0x37864);
        }
    }
    public class LptAccess
    {
        [DllImport("inpout32.dll", EntryPoint = "Out32")]
        public static extern void Output(int address, int val);
        [DllImport("inpout32.dll", EntryPoint = "Out32")]
        public static extern void Input(int address);


Ich sollte noch dazu sage das ich Win 7 nutze.Liegt es vielleicht daran. Unter XP lief es immer

MFG

blutengel


Greenberet - Di 28.12.10 00:01

Google [http://lmgtfy.com/?q=Es+wurde+versucht%2C+eine+Datei+mit+einem+falschen+Format+zu+laden.+(Ausnahme+von+HRESULT%3A+0x8007000B)]...erster treffer liefert die Antwort