program hangs while accessing parallel port in VB

ppvs used Ask the Experts™
the following code does not work properly.

write this code on command button's click

open "LPT1:" for output as #1
print #1,"255"
close #1

this code hangs after it comes to the 'close #1' stage

please suggest any modifications.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hello ppvs,

i would suggest using the printer object included in vb.

Author of the Year 2009

Hi ppvs,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept VK's comment(s) as an answer.

ppvs, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept THIS comment as an answer.
DanRollins -- EE database cleanup volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial