Link to home
Start Free TrialLog in
Avatar of Reachtabhair
Reachtabhair

asked on

Using command lines to operate OCR software through VB6

Hi

I'm having real difficulty with using command lines to control a OCR program through Visual Basic 6.

Basically I have command lines to control a OCR program called SimpleOCR, and honestly I have no Idea how!!

So far I've tried running through DOS with very little luck.
Is there an easier way to use these command lines to access my OCR software.

Thanking in advance
Avatar of ADSaunders
ADSaunders

Hi Reachtabhair,
Dim RetVal
RetVal = Shell("pathtocommandlinecommand.EXE", 1)   ' Run command.

However, this will start the command, but not wait for it to finish.

For more subtle control, you'll have to look into the ShellExecute or ShellExecuteEX API.

Regards .. Alan
Avatar of Reachtabhair

ASKER

Hi alan
thanks for the reply

This is what i've done so far, the problem is that I keep getting a error called 'File Creation Error' on the DOS screen.

If you could have a look at the code and give me your opnion it would be greatly appreciated....


Private Sub Command1_Click()
    Open "C:\commandline.bat" For Output As #1
    Print #1, "Cd .."
    Print #1, "Cd .."
    Print #1, "Cd .."
    Print #1, "Cd .."
    Print #1, "cd progra~1"
    Print #1, "cd Simple~1"
    Print #1, "cd bin"
    Print #1, "simpleocrcmd"
    Print #1, "SimpleOCRCmd [/NONE] <C:\images\Test.tif> <C:\text\line.txt>"
    Close #1
   
    Shell ("C:\commandline.bat"), vbNormalFocus
End Sub


ASKER CERTIFIED SOLUTION
Avatar of ADSaunders
ADSaunders

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks a milion Alan

Gary