Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OPOS EnabledDevice problem
Message
 
 
To
06/01/2003 22:28:49
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00737166
Message ID:
00738812
Views:
14
The only difference I have is I put 100 as the parameter in the ClaimDevice method call -- ClaimDevice(100). I also claim it in a loop:
lnRetry = 0
DO WHILE lnRetry < 10
   lnRetVal = THISFORM.oleStar.ClaimDevice(100)
   IF lnRetVal = 0
      EXIT
   ENDIF
   lnRetry = lnRetry + 1
ENDDO
My other code revision is at the end of your code below. I do not see a problem with the rest of the code. Since I use Epson printers, there could be a problem with what Star is providing to you or it could be my lack of familiarity with the Star printers and what they are providing with their control.

>Hi Mark,
>
>I tried your method but still having the same problem, see the hour glass and program not responsing when you tell task manager in Win2k.
>
>Below is part of my testing code, hope u can see my mistake, thank
>      #DEFINE PRTNAME [TSP442D]
>      IF THISFORM.olestar.Open(PRTNAME) = 0
>         IF THISFORM.olestar.ClaimDevice(0) = 0
>            THISFORM.olestar.DeviceEnabled = .T.
>            THISFORM.olestar.AsyncMode = .F.
>            Messagebox("Printer enabled")
>            IF THISFORM.oleStar.CapRecNearEndSensor = .F.
>               Messagebox("Printer don't have near end sensor")
>            ELSE
>               Messagebox("Printer have near end sensor")
>               IF THISFORM.oleStar.RecNearEnd
>                  Messagebox("Printer receipt paper is low")
>               ENDIF
>            ENDIF
>            IF THISFORM.olestar.CapRecEmptySensor
>               IF THISFORM.olestar.RecEmpty
>                  Messagebox("Paper is empty")
>               ELSE
>                  Messagebox("Paper is okay")
>               ENDIF
>            ELSE
>               Messagebox("Printer don't have empty sensor")
>            ENDIF
>         ENDIF
>         IF THISFORM.oleStar.Claimed
*!* I do not do this. I just close the device.
*!*            THISFORM.oleStar.ReleaseDevice()
*!*            Messagebox("going to close the device")
>            THISFORM.olestar.Close()
>            Messagebox("All done")
>         ENDIF
>      ENDIF
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform