CreateProcess on Pocket PC in vbnet cf

F

Fex

Hi all,

there are a lot of threats here with the problem how to start another
process on a Pocket PC, but there is no real answer... some broken
links and so on...

Can me tell anyone how I can start another process with Createprocess
(VB.NET)?

I'm using the following declaration, but it doesn't work...

Public Structure PROCESS_INFORMATION
Public hProcess As Integer
Public hThread As Integer
Public dwProcessId As Integer
Public dwThreadId As Integer
End Structure

Private Declare Function CreateProcess Lib "coredll.Dll" (ByVal
strImageName As String, ByVal strCmdLine As String, ByVal
pProcessAttributes As IntPtr, ByVal pThreadAttributes As IntPtr, ByVal
bInheritsHandle As Integer, ByVal dwCreationFlags As Integer, ByVal
pEnvironment As IntPtr, ByVal pCurrentDir As IntPtr, ByVal bArray() As
[Byte], ByVal oProc As PROCESS_INFORMATION) As Integer

Dim PI As PROCESS_INFORMATION
Dim Command as String

CreateProcess("any.exe", Command, IntPtr.Zero, IntPtr.Zero, 0, 0,
IntPtr.Zero, IntPtr.Zero, New Byte(128) {}, PI)


Thanks,
Fex
 
F

Fex

Okay, that's working!

Many thanks to you!

Fex

Peter Foot said:
As your PROCESS_INFORMATION is declared as a struct, you should pass it
ByRef in your P/Invoke declaration.
As far as there being no answer, there are a number of working
implementations out there such as this quickstart:-
http://samples.gotdotnet.com/quickstart/CompactFramework/doc/waitforsingleobject.aspx
There is also an OpenNETCF.Diagnostics.Process class in the SDF -
www.opennetcf.org/sdf/ which works just like the desktop .NET equivalent.

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://blog.opennetcf.org/pfoot/

Fex said:
Hi all,

there are a lot of threats here with the problem how to start another
process on a Pocket PC, but there is no real answer... some broken
links and so on...

Can me tell anyone how I can start another process with Createprocess
(VB.NET)?

I'm using the following declaration, but it doesn't work...

Public Structure PROCESS_INFORMATION
Public hProcess As Integer
Public hThread As Integer
Public dwProcessId As Integer
Public dwThreadId As Integer
End Structure

Private Declare Function CreateProcess Lib "coredll.Dll" (ByVal
strImageName As String, ByVal strCmdLine As String, ByVal
pProcessAttributes As IntPtr, ByVal pThreadAttributes As IntPtr, ByVal
bInheritsHandle As Integer, ByVal dwCreationFlags As Integer, ByVal
pEnvironment As IntPtr, ByVal pCurrentDir As IntPtr, ByVal bArray() As
[Byte], ByVal oProc As PROCESS_INFORMATION) As Integer

Dim PI As PROCESS_INFORMATION
Dim Command as String

CreateProcess("any.exe", Command, IntPtr.Zero, IntPtr.Zero, 0, 0,
IntPtr.Zero, IntPtr.Zero, New Byte(128) {}, PI)


Thanks,
Fex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top