|
-
July 12th, 2000, 01:39 PM
#1
parallel port
Anyone have any tips on how to access the parallel port in C code - i'm thinking using outp at some address, but i don't know the address of the parallel port. is all the data i need for accessing it in the device manager on my control panel? and finally, how can i access the port directly?
thanks
-
July 12th, 2000, 03:09 PM
#2
Re: parallel port
You're in the wrong message board, but if you do a CreateFile and pass in the file name "COM1" you can open a com port. I'd assume passing in "LPT1" would open that port as well.
-
October 5th, 2002, 01:53 AM
#3
Sorry, I can't help you at the moment but I am working on a comport wrapper/driver. Due to some problems in the .NET code it's not possible for me to give you the files you need.
I will look also for a wrapper around the COM code for the parallel port.
WM.
What about weapons of mass construction?
-
February 11th, 2004, 05:22 AM
#4
Has anyone become any wiser regarding this subject?
This is something I have used in c++ but how can I use api functions like CreateFile in c#?
Maybe there is a better way?
All help appretiated.
s2 = "Kalle";
s = "LPT1";
h = CreateFile(s,GENERIC_WRITE or
GENERIC_READ,0,nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
if (h = INVALID_HANDLE_VALUE)
{
b= false;
}
b = WriteFile(h,s2 ,5,written,nil);
CloseHandle(h);
-
February 11th, 2004, 10:33 AM
#5
Code:
[DllImport("kernel32.dll")]
public external int CreateFile(.......)
The DllImport Attribute can be used to import API functions from other COM Dll files and Win32 dll files. So this can also be used to import windows API Functions into C#.
WM.
What about weapons of mass construction?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|