Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem with inpout32.dll

Status
Not open for further replies.

anjosoviaj

Member level 1
Joined
Dec 25, 2007
Messages
38
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,533
inpout32 c#

hi ,

i'm doing a project that requires parallel port communication in C#. On googling, i found that this can be done using the inpout32.dll. So i downloaded it and placed it in the system32 folder of Windows.But i'm not able to use it in the program. It is showing a missing library reference or assembly directive.

I'm not able to add it to the references.It is showing error.

Is any kind of registry problems associated with this dll??

please help..
 

inpout32.dll c#

Assalamo Allykum !

First please paste the " inpout32.DLL " in the C:\WINDOWS\system32 and in the folder C:\WINDOWS\system

Then

Please add these two lines at the starting of your project.


Private Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Private Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)


I hope that after that it will work properly.
 

c# inpout32.dll

hi,

thanks for the reply..
i'm working on C#..Can u please tell me the code lines mentioned above in C#?



thanks
 

inpout32

add a class to your project, in this case PortAccess. (The namespace Windowsapplication5 is what the editor added because that was the name of the
project.) Notice that you do not create an object of this class. You use it directly since the methods are static (I believe they must be declared static)

name the class whatever you want. Name your methods anything you want. This is
from the codeproject site where a guy describes his LCD project using the PP.
I just added the In method to complete the class.


using System;
using System.Runtime.InteropServices;


namespace WindowsApplication5
{

public class PortAccess
{
[DllImport("inpout32.dll", EntryPoint = "Out32")]
public static extern void Out(int adress, int value);

[DllImport("inpout32.dll", EntryPoint = "Inp32")]
public static extern int In(int address);

}
}

Now you can access the code as you would any other class:

PortAccess.Out(888, 56);
int i = 0;
i = PortAccess.In(888);

I always use the io.dll. It has a lost of other functions that can come in handy.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top