Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem in executing Exe from Visual Basic.

Ratnakar Pedagani
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi,

I'm trying to execute a GUI application from visual basic (named
PathProx.exe). this pathprox.exe is linked to different files that are
present in the same directory as pathprox. when i'm trying execute
pathprox.exe directly, i could run the application without any errors,
but when i'm executing the same using visual basic with the following
code, pathprox.exe is unable to link with those files. its giving some
errors. i dont have the source code for pathprox application. can
anybody suggest me as where i'm going wrong or any solution for this?

Dim pInfo As PROCESS_INFORMATION
Dim sInfo As STARTUPINFO
Dim sNull As String
Dim lSuccess As Long
Dim lRetValue As Long

sInfo.cb = Len(sInfo)
lSuccess = CreateProcess(sNull, _

"C:\RIAAS_Simulator_RSM\PathProx.exe", _
ByVal 0&, _
ByVal 0&, _
1&, _
NORMAL_PRIORITY_CLASS, _
ByVal 0&, _
sNull, _
sInfo, _
pInfo)

lRetValue = TerminateProcess(pInfo.hProcess, 0&)
lRetValue = CloseHandle(pInfo.hThread)
lRetValue = CloseHandle(pInfo.hProcess)

Thanking you,
Regards,
Ratnakar Pedagani.

Steve Gerrard
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Problem in executing Exe from Visual Basic.



"Ratnakar Pedagani" <ratnakarp2002@yahoo.co.in> wrote in message
news:5b0601e5.0408201822.1d4dba72@posting.google.c om...
| Hi,
|
| I'm trying to execute a GUI application from visual basic (named
| PathProx.exe). this pathprox.exe is linked to different files that are
| present in the same directory as pathprox. when i'm trying execute
| pathprox.exe directly, i could run the application without any errors,
| but when i'm executing the same using visual basic with the following
| code, pathprox.exe is unable to link with those files.

| lSuccess = CreateProcess(sNull, _
|
| "C:\RIAAS_Simulator_RSM\PathProx.exe", _
| ByVal 0&, _
| ByVal 0&, _

You may just need to put

ChDir "C:\RIAAS_Simulator_RSM"

before calling CreateProcess.


Eddie B
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Problem in executing Exe from Visual Basic.


How bout this...


lSuccess = CreateProcess(sNull, _
"C:\RIAAS_Simulator_RSM\PathProx.exe", _
ByVal 0&, _
ByVal 0&, _
1&, _
NORMAL_PRIORITY_CLASS, _
ByVal 0&, _
"C:\RIAAS_Simulator_RSM", _
sInfo, _
pInfo)





On 20 Aug 2004 19:22:41 -0700, ratnakarp2002@yahoo.co.in (Ratnakar
Pedagani) wrote:
[color=blue]
>Hi,
>
>I'm trying to execute a GUI application from visual basic (named
>PathProx.exe). this pathprox.exe is linked to different files that are
>present in the same directory as pathprox. when i'm trying execute
>pathprox.exe directly, i could run the application without any errors,
>but when i'm executing the same using visual basic with the following
>code, pathprox.exe is unable to link with those files. its giving some
>errors. i dont have the source code for pathprox application. can
>anybody suggest me as where i'm going wrong or any solution for this?
>
>Dim pInfo As PROCESS_INFORMATION
> Dim sInfo As STARTUPINFO
> Dim sNull As String
> Dim lSuccess As Long
> Dim lRetValue As Long
>
> sInfo.cb = Len(sInfo)
> lSuccess = CreateProcess(sNull, _
>
>"C:\RIAAS_Simulator_RSM\PathProx.exe", _
> ByVal 0&, _
> ByVal 0&, _
> 1&, _
> NORMAL_PRIORITY_CLASS, _
> ByVal 0&, _
> sNull, _
> sInfo, _
> pInfo)
>
> lRetValue = TerminateProcess(pInfo.hProcess, 0&)
> lRetValue = CloseHandle(pInfo.hThread)
> lRetValue = CloseHandle(pInfo.hProcess)
>
>Thanking you,
>Regards,
>Ratnakar Pedagani.[/color]

Closed Thread