Balaji
April 12th, 1999, 08:37 AM
Hi there
I am calling a clipper executable in my VB program. I am using Win95
APIs for that.
Code as follows
Private Declare Function OpenProcess Lib "kernel32" (ByVal
dwDesiredAccess As Long, ByVal bInheritHandle _
As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal
hProcess As Long, lpExitCode As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As
Long)
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400
Sub Shell32Bit(ByVal JobToDo As String)
Dim hProcess As Long
Dim RetVal As Long
'The next line launches JobToDo as icon,
'captures process ID
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False,
Shell(JobToDo, 6))
Do
'Get the status of the process
GetExitCodeProcess hProcess, RetVal
'Sleep command recommended as well
'as DoEvents
DoEvents: Sleep 100
'Loop while the process is active
Loop While RetVal = STILL_ACTIVE
MsgBox "Notepad terminated by user"
End Sub
Option Explicit
Private Sub Command1_Click()
Dim JobToDo As String
JobToDo = "d:\sita\convert.exe FEB99 FEB99" ' our exe
Shell32Bit JobToDo
End Sub
The following clipper settings also made in the config.sys
1. set clipper=f:70
2. files=70
3. buffers=80
Now the problem is The above code just opens a DOS windows and it
closes. It doesn't show the clipper screen.This code works with any
other DOS based program. Our clipper executable works well if we
execute thru DOS mode.
How we can solve this problem. Please help us
Waiting for ur reply.
Thanks for your cooperation.
Saju Varghese
I am calling a clipper executable in my VB program. I am using Win95
APIs for that.
Code as follows
Private Declare Function OpenProcess Lib "kernel32" (ByVal
dwDesiredAccess As Long, ByVal bInheritHandle _
As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal
hProcess As Long, lpExitCode As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As
Long)
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400
Sub Shell32Bit(ByVal JobToDo As String)
Dim hProcess As Long
Dim RetVal As Long
'The next line launches JobToDo as icon,
'captures process ID
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False,
Shell(JobToDo, 6))
Do
'Get the status of the process
GetExitCodeProcess hProcess, RetVal
'Sleep command recommended as well
'as DoEvents
DoEvents: Sleep 100
'Loop while the process is active
Loop While RetVal = STILL_ACTIVE
MsgBox "Notepad terminated by user"
End Sub
Option Explicit
Private Sub Command1_Click()
Dim JobToDo As String
JobToDo = "d:\sita\convert.exe FEB99 FEB99" ' our exe
Shell32Bit JobToDo
End Sub
The following clipper settings also made in the config.sys
1. set clipper=f:70
2. files=70
3. buffers=80
Now the problem is The above code just opens a DOS windows and it
closes. It doesn't show the clipper screen.This code works with any
other DOS based program. Our clipper executable works well if we
execute thru DOS mode.
How we can solve this problem. Please help us
Waiting for ur reply.
Thanks for your cooperation.
Saju Varghese