471,083 Members | 1,123 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,083 software developers and data experts.

Problem in executing Exe from Visual Basic.

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.
Jul 17 '05 #1
2 3149

"Ratnakar Pedagani" <ra***********@yahoo.co.in> wrote in message
news:5b**************************@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.
Jul 17 '05 #2
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, ra***********@yahoo.co.in (Ratnakar
Pedagani) wrote:
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.


Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by longtungd1 | last post: by
19 posts views Thread by David zhu | last post: by
2 posts views Thread by Joseph Geretz | last post: by
13 posts views Thread by Lee Newson | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.