Paralle port programming, VC++ 6.0, W2K...turning on/off LED's on data out pins D0-D7

Hi,
There is alot of info out htere referring to this sort of work, like the famous "Controlling LED's with parallel port article in Codeproject which is years old, and other stuff that is also outdated. Looking around here there are some tidbits of info, but no clear direction for someone like myself who is not an expert. I know about the functions like CreateFile() and DeviceIoControl() , but it'S not obvious for me to know how to use them. Anyone already done small tests with just turning on/off LED's on the port and have some code example? I have theinpout32.dll, but when I try to register it (regsvr32) it tell me it's loaded, but the DLLRegisterServer Entry Point was not found...so the little codeproject example, which looks really like what I need, will not function. Any help out there please? Thanks!
pigeonbrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
>>I have theinpout32.dll, but when I try to register it (regsvr32) it tell me it's loaded, but the
>>DLLRegisterServer Entry Point was not found

It is probably just not a COM DLL, but a regular DLL, so no registration required. See e.g. http://www.logix4u.net/parallelport1.htm ("Parallel port Interfacing Tutorial"), it also refers to using that inpout32.dll on NT and later at http://www.logix4u.net/inpout32.htm
0
pigeonbrAuthor Commented:
Why doesn't the program work if i don't have to register the .ddl then? Check out this link:
http://www.codeproject.com/csharp/csppleds.asp?msg=792594

Everything would seem to be there that I need, but it won't work....any ideas if it's not because of the .dll? Download the demo project and give it a try...I get a window that opens and the program seems to be looking for a file in c:\c#\LED\off.gif. Any help will greatly be appreciated. :)
0
jkrCommented:
This is a C#(!) managed app, it can only 'talk' to a Win32 DLL via P/Invoke or COM Interop. The DLL (inpout32) is not COM DLL, it only exports two functions ('Inp32()' and 'Out32()'), but no COM functionality that needs to be registered, thus no 'DllRegisterServer()'.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

pigeonbrAuthor Commented:
jkr:
Ok, then..so that's not for me. Can you help with my question by suggesting other options I can try please?
0
jkrCommented:
Err, I thought you wanted to use inpout32.dll? This is not the C# area ;o)
0
pigeonbrAuthor Commented:
jkr:
No, not necessarily...like i said, I'm no expert...I'm just looking for the easiest way to do this , that's all. I have no preference...just a way out...so, if you have any suggestions, I'm all ears.:) Thanks!
0
jkrCommented:
I'd go that way, since there aren't too many alternatives. Everythig that MS designed to work with the parallel port on NT et. al. is more addressing the communication with a printer (see e.g. http://support.microsoft.com/kb/138594/EN-US/ - "HOWTO: Send Raw Data to a Printer by Using the Win32 API"). If you want to access the individual pins, the examples at http://www.logix4u.net/parallelport1.htm should be the best solution (not mwntioning other similar approaches like 'direcnt.sys')
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pigeonbrAuthor Commented:
Thanks jkr,...I will accept this and take time a little later to check it out...looks very interesting....if need be I will be back :) Thanks for your time!
Bruce
0
pigeonbrAuthor Commented:
Hi jkr...I'm Back :)

Just tried the sample program, and made sure my inpout32.dll. was right one, and located in WINNT\system32 folder...but I still get errors when I run the commande line ex: partest1 write 888 255, which should light up my 8 LED's. The program give me an app error windoe with an address. Any ideas?
0
jkrCommented:
Are you running it under an admin account? That's necessary so the driver can be loaded.
0
jkrCommented:
Oh, the driver is called 'hwinterface.sys' and comes with http://www.logix4u.net/inpout32_source_and_bins.zip
0
pigeonbrAuthor Commented:
Yes, I am running under administrator.

I'm trying the code out on another HD i have running W98, and more seems to be working....the LED's are illuminating opposite to what I would think...when I write 888 255, all leds go off, and the first 3 LED's (1,2,4) dont ever light up. Still working on it...when I get it working right in Win98, maybe easier to migrate to W2k.
0
pigeonbrAuthor Commented:
About the driver 'hwinterface.sys' ,....where do I put i? In the system32 directory?
0
pigeonbrAuthor Commented:
Maybe my parallel connector is defective, as my D0-D3 lights never go on....but the HEX output for the LED's which is normally 1,2,4,8,16, etc for D0,D1,D2,D3,D4,etc respectively is not in order. I'm scratching my head now :)
0
pigeonbrAuthor Commented:
I got my wiring staightened out :)...haha...they are all ok now...had my DB 25 soldered backwards...still won't work in w2k...let me know abour the hwinterface.sys file...what do I do with it? Thanks.
0
pigeonbrAuthor Commented:
All woorks fine now in W98. I can work each bit ....let me know....I will keep trying in W2k. Thanks
0
jkrCommented:
Sorry for the delay, I've been out for a while. Yes, the driver should be put in 'system32' also - that's the component that makes it possible to directly acces I/O ports in the 1st place.
0
pigeonbrAuthor Commented:
jkr;
Ok...So my console app works now in W2K....thanks to your guidance and a few tests here. Now its to get the thing to work from a VC++ app and not from console application. Thanks for the help...you saved my many days of frustration! I appreciate it! I am now pointed in the right direction!
bruce
Quebec, Canada
0
jkrCommented:
You're most welcome ;o)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.