473,320 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 3209

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: longtungd1 | last post by:
I'm currently taking a Visual C++ course. I have C++ version 6.0 on my machine. I set up a basic program per course instructions to simply create a window with default toolbar, etc., using App...
19
by: David zhu | last post by:
I've got different result when comparing two strings using "==" and string.Compare(). The two strings seems to have same value "1202002" in the quick watch, and both have the same length 7 which I...
2
by: Joseph Geretz | last post by:
I'm having a credentialing problem in my web application. Actually, I don't think this is an IIS security issue, since I'm able to access the page I'm requesting. However, the executing page itself...
0
by: Fiona McBride | last post by:
Hi all, I have a really odd problem with some Visual Basic .NET 2003 code; I have a program that creates a number of windows which contain RichTextBox, Timers (disabled) and menus. The code...
3
by: Eva | last post by:
Hi All Is it possible to connect to a remote machine running a vb.net application, access the C drive on the remote machine and execute an exe from the server programatically Eva
13
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that...
10
by: Bryce Calhoun | last post by:
Hello, First of all, this is a .NET 1.1 component I'm creating. SUMMARY ----------------------- This component that I'm creating is, for all intents and purposes, a document parser (I'm...
102
by: hug | last post by:
www.webmaster, was suggested that this ng could be a better place.] I've updated my test server to handle if-modified-since. I've noticed that the (old copies I run of) IE and Netscape seem...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.