473,414 Members | 1,677 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,414 software developers and data experts.

CreateProcess problems in vb.NET (only experts need apply ;-)

Hi All :)

Would be grateful of advice please. I have code in VB6
working as follows:

lngReply = CreateProcess(sNull, txtStart, ByVal 0&,
ByVal 0&, 1&, _
NORMAL_PRIORITY_CLASS, ByVal 0&, sNull, sInfo,
pInfo)

but alas, the 'equivelant' vb.Net code translated as:
lngReply = CreateProcess(sNull, txtStart.Text, sa,
sa, 1, _
NORMAL_PRIORITY_CLASS, 0, sNull, sInfo, pInfo)
does not execute cleanly. That is, although the
CreateProcess returns 'successfully', and populates the
sInfo structure with valid data, the application (e.g.
c:\windows\notepad.exe) 'fails during initialisation' and
terminates.

The only 'meaningful' difference between the working vb6
and non-working vb.net code, is the substitution of
vb6's 'As Any' Win32API declaration parameterss with 'AS
Securities_Attributes' structures, which I have defined
thus:

Structure SECURITY_ATTRIBUTES
Dim nLength As Integer
Dim lpSecurityDescriptor As Integer
Dim bInheritHandle As Integer
End Structure

and are passed-in called 'sa', as noted above.

Please, can someone offer either a correction for my
error, or a good code example / reference for calling
CreateProcess from vb.net.

NB: I need to use CreateProcess rather than the Process
component that is available in the managed code, as I
need to set some 'lower level' start info parameters
(i.e. the lpDesktop setting), which I can only get at
using the API directly :(

Many Thanks in advance,
Paul.
Nov 20 '05 #1
2 1994
* "Paul Schenk" <pa*@rttracking.com> scripsit:
[...]

See reply in the upgrade group. Please don't multipost.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
"Herfried K. Wagner

See reply in the upgrade group. Please don't multipost.


That is the only answer the only "Expert" in this newsgroup can give.

:-)

Cor
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Achim Domma | last post by:
Hi, I try to start a process on windows using win32process.CreateProcess and want to to redirect the output. I set the STARTF_USESTDHANDLES flag in the STARTUPINFO structure. But I can not...
0
by: ByteSize | last post by:
Would be grateful of advice please. I have code in VB6 working as follows: lngReply = CreateProcess(sNull, txtStart, ByVal 0&, ByVal 0&, 1&, _ NORMAL_PRIORITY_CLASS, ByVal 0&, sNull, sInfo,...
1
by: DOT NET JIM | last post by:
in VB6 the api declares the createprocess lbEnv var as any. When converted to ..NET is change the type any to Object. The problem is, what kind of object. I can not get the env variables set when...
14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
7
by: Grant | last post by:
Ok I have XP Pro and recently upgraded to SP2 but after doing so one of my favorite webpages to check daily does not respond the same as before. It used to be (pre SP2) that I could when visiting...
3
by: kal | last post by:
Hi, I am trying to write an application that will launch a second application using CreateProcess... SECURITY_ATTRIBUTES sa; STARTUPINFO si; PROCESS_INFORMATION pi; ::ZeroMemory( &sa,...
5
by: Stefano Camaiani | last post by:
Hello, please someone have the working code on how to call the CreateProcess API in Vb.Net? I need to call the CreateProcess API directly and i should not use the Vb.Net Process functions like dim...
1
by: Jai | last post by:
Please provide sample code for using Createprocess in VB.NET. The code I am using is given below. But I get "Error 91: Object referrence not set to an instance of the object" at CreateProcess...
6
by: ss.teo | last post by:
I want to fork a new process and my executable binary is stored inside somewhere. Is there any possible way to fork a process using CreateProcess API without writing to the disk first? Like let's...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.