Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Problem in executing Exe from Visual Basic.
Old
  (#1)
Ratnakar Pedagani
Guest
 
Posts: n/a
Default Problem in executing Exe from Visual Basic. - 06-04-2007, 09:47 AM

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_CL***, _
ByVal 0&, _
sNull, _
sInfo, _
pInfo)

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

Thanking you,
Regards,
Ratnakar Pedagani.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Problem in executing Exe from Visual Basic.
Old
  (#2)
Steve Gerrard
Guest
 
Posts: n/a
Default Re: Problem in executing Exe from Visual Basic. - 06-04-2007, 09:47 AM


"Ratnakar Pedagani" <EMAIL REMOVED> wrote in message
news:EMAIL REMOVED 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.


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Problem in executing Exe from Visual Basic.
Old
  (#3)
Eddie B
Guest
 
Posts: n/a
Default Re: Problem in executing Exe from Visual Basic. - 06-04-2007, 09:48 AM

How bout this...


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





On 20 Aug 2004 19:22:41 -0700, EMAIL REMOVED (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_CL***, _
> ByVal 0&, _
> sNull, _
> sInfo, _
> pInfo)
>
> lRetValue = TerminateProcess(pInfo.hProcess, 0&)
> lRetValue = CloseHandle(pInfo.hThread)
> lRetValue = CloseHandle(pInfo.hProcess)
>
>Thanking you,
>Regards,
>Ratnakar Pedagani.


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top