Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Start a PowerBuilder or a Visual BAsic application from
Message
From
28/08/2002 10:21:13
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00694183
Message ID:
00694435
Views:
9
>How do I start a PowerBuilder or a Visual BAsic application from FoxPro?


here is an example of how to run an instance of Adobe Distiller
and wait for completion. just change Command_String to specify
the executable for your PB or VB application. thanks to another
UT member for this technique, but sorry to say, i do not remember
who.

Distiller_EXE_Spec is a global set elsewhere in this particular
case.
*-----------------run distiller and wait for close the window--------------
  LOCAL Startup_Info
  LOCAL Process_Info
  LOCAL Command_String
  LOCAL Return_Code
  LOCAL hProcess
  

  Startup_Info = long2str(68) + REPLICATE(CHR(0), 64)
  Process_Info = REPLICATE(CHR(0), 16)
  Command_String = ALLTRIM(Distiller_EXE_Spec) + ' ' + ALLTRIM (PS_PDF_Combiner_File_Spec) + CHR(0)
  Return_Code = CreateProcess(0 , Command_String , 0 , 0 , 1 , NORMAL_PRIORITY_CLASS, 0, 0, @Startup_Info, @Process_Info )
  IF Return_Code = 0
     =MESSAGEBOX("Error occurred. Error code: ", GetLastError())
     RETURN
  ENDIF
  hProcess = str2long(SUBSTR(Process_Info, 1, 4))
  DO WHILE ( .T. )
    IF ( WaitForSingleObject(hProcess, WAIT_INTERVAL) != WAIT_TIMEOUT )
      EXIT
    ELSE
      DOEVENTS
    ENDIF
  ENDDO
  Return_Code = CloseHandle (hProcess)
patrick
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform