PC Review


Reply
Thread Tools Rate Thread

CreateProcess

 
 
Harry Simpson
Guest
Posts: n/a
 
      22nd Jul 2008
I'm in VS2008, trying to create a simple little CF app to run WCELOAD to execute a CPF.
I've added a reference to OpenNETCF but for the life of me cannot find the diagnostics namespace....The smart device app wants me to use
Namespace System.Diagnostics

Member of System


Where do I hook into the OpenNETCF stuff

I've seen references in the archives to this - some with extra whacks and some without so I'm a little confused.
Anything wrong with this syntax that's pops out?

Dim argPath As String = "/noaskdest /noui \Storage Card\\pprofile.cpf"

Dim argName As String = "\" + argPath + " \"



Dim programPath As String = "\windows\\wceload.exe"

Dim programName As String = "\" + programPath + "\"



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Process.Start(programName, argName)

End sub



The programName, argName in a messagebox looks like this:

\\windows\\wceload.exe\ \/noaskdest /noui \Storage Card\\pprofile.cpf\

Which when I run the silly app I get a Win32 error so....it's probably as bad as it looks....







 
Reply With Quote
 
 
 
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      22nd Jul 2008
What OpenNETCF stuff? The Process class is part of the CF, so you just call it like so:

System.Diagnostics.Process.Start("wceload.exe", "my params");

It's pretty well documented online:
http://msdn.microsoft.com/en-us/libr...s.process.aspx


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com


"Harry Simpson" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
I'm in VS2008, trying to create a simple little CF app to run WCELOAD to execute a CPF.
I've added a reference to OpenNETCF but for the life of me cannot find the diagnostics namespace....The smart device app wants me to use
Namespace System.Diagnostics

Member of System


Where do I hook into the OpenNETCF stuff

I've seen references in the archives to this - some with extra whacks and some without so I'm a little confused.
Anything wrong with this syntax that's pops out?

Dim argPath As String = "/noaskdest /noui \Storage Card\\pprofile.cpf"

Dim argName As String = "\" + argPath + " \"



Dim programPath As String = "\windows\\wceload.exe"

Dim programName As String = "\" + programPath + "\"



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Process.Start(programName, argName)

End sub



The programName, argName in a messagebox looks like this:

\\windows\\wceload.exe\ \/noaskdest /noui \Storage Card\\pprofile.cpf\

Which when I run the silly app I get a Win32 error so....it's probably as bad as it looks....







 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      22nd Jul 2008
There are multiple possible problems. Your programPath declaration is
clearly wrong. There wouldn't be one backslash at the beginning and two in
the middle. I think that you want \\ at each path separator. And, in your
argPath, you're going to need some quotes around that path to the .cpf file,
since it's in a path that has a space in it. Something more like this:

Dim argPath As String = "/noaskdest /noui \"\\Storage Card\\pprofile.cpf\""

and then I don't think you want argName at all and don't want to use it.
argPath seems like your parameters, to me.

Paul T.

"Harry Simpson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
I'm in VS2008, trying to create a simple little CF app to run WCELOAD to
execute a CPF.
I've added a reference to OpenNETCF but for the life of me cannot find the
diagnostics namespace....The smart device app wants me to use
Namespace System.Diagnostics

Member of System


Where do I hook into the OpenNETCF stuff

I've seen references in the archives to this - some with extra whacks and
some without so I'm a little confused.
Anything wrong with this syntax that's pops out?

Dim argPath As String = "/noaskdest /noui \Storage Card\\pprofile.cpf"

Dim argName As String = "\" + argPath + " \"



Dim programPath As String = "\windows\\wceload.exe"

Dim programName As String = "\" + programPath + "\"



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Process.Start(programName, argName)

End sub



The programName, argName in a messagebox looks like this:

\\windows\\wceload.exe\ \/noaskdest /noui \Storage Card\\pprofile.cpf\

Which when I run the silly app I get a Win32 error so....it's probably as
bad as it looks....








 
Reply With Quote
 
Harry Simpson
Guest
Posts: n/a
 
      23rd Jul 2008
Thanks Chris and Paul,

Easiest way I found that works is KISS principle
Dim processInfo As New ProcessStartInfo

processInfo.FileName = " \Storage Card\profile.cpf"

Try

Dim ProfileProcess As Process = Process.Start(processInfo)

Catch ex As Exception

End Try

Thanks

Harry

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:(E-Mail Removed)...
> There are multiple possible problems. Your programPath declaration is
> clearly wrong. There wouldn't be one backslash at the beginning and two
> in the middle. I think that you want \\ at each path separator. And, in
> your argPath, you're going to need some quotes around that path to the
> .cpf file, since it's in a path that has a space in it. Something more
> like this:
>
> Dim argPath As String = "/noaskdest /noui \"\\Storage
> Card\\pprofile.cpf\""
>
> and then I don't think you want argName at all and don't want to use it.
> argPath seems like your parameters, to me.
>
> Paul T.
>
> "Harry Simpson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> I'm in VS2008, trying to create a simple little CF app to run WCELOAD to
> execute a CPF.
> I've added a reference to OpenNETCF but for the life of me cannot find the
> diagnostics namespace....The smart device app wants me to use
> Namespace System.Diagnostics
>
> Member of System
>
>
> Where do I hook into the OpenNETCF stuff
>
> I've seen references in the archives to this - some with extra whacks and
> some without so I'm a little confused.
> Anything wrong with this syntax that's pops out?
>
> Dim argPath As String = "/noaskdest /noui \Storage Card\\pprofile.cpf"
>
> Dim argName As String = "\" + argPath + " \"
>
>
>
> Dim programPath As String = "\windows\\wceload.exe"
>
> Dim programName As String = "\" + programPath + "\"
>
>
>
> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> Process.Start(programName, argName)
>
> End sub
>
>
>
> The programName, argName in a messagebox looks like this:
>
> \\windows\\wceload.exe\ \/noaskdest /noui \Storage Card\\pprofile.cpf\
>
> Which when I run the silly app I get a Win32 error so....it's probably as
> bad as it looks....
>
>
>
>
>
>
>
>



 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      23rd Jul 2008
Yep, should have thought of that myself...

Paul T.

"Harry Simpson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks Chris and Paul,
>
> Easiest way I found that works is KISS principle
> Dim processInfo As New ProcessStartInfo
>
> processInfo.FileName = " \Storage Card\profile.cpf"
>
> Try
>
> Dim ProfileProcess As Process = Process.Start(processInfo)
>
> Catch ex As Exception
>
> End Try
>
> Thanks
>
> Harry
>
> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> com> wrote in message news:(E-Mail Removed)...
>> There are multiple possible problems. Your programPath declaration is
>> clearly wrong. There wouldn't be one backslash at the beginning and two
>> in the middle. I think that you want \\ at each path separator. And, in
>> your argPath, you're going to need some quotes around that path to the
>> .cpf file, since it's in a path that has a space in it. Something more
>> like this:
>>
>> Dim argPath As String = "/noaskdest /noui \"\\Storage
>> Card\\pprofile.cpf\""
>>
>> and then I don't think you want argName at all and don't want to use it.
>> argPath seems like your parameters, to me.
>>
>> Paul T.
>>
>> "Harry Simpson" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> I'm in VS2008, trying to create a simple little CF app to run WCELOAD to
>> execute a CPF.
>> I've added a reference to OpenNETCF but for the life of me cannot find
>> the diagnostics namespace....The smart device app wants me to use
>> Namespace System.Diagnostics
>>
>> Member of System
>>
>>
>> Where do I hook into the OpenNETCF stuff
>>
>> I've seen references in the archives to this - some with extra whacks and
>> some without so I'm a little confused.
>> Anything wrong with this syntax that's pops out?
>>
>> Dim argPath As String = "/noaskdest /noui \Storage Card\\pprofile.cpf"
>>
>> Dim argName As String = "\" + argPath + " \"
>>
>>
>>
>> Dim programPath As String = "\windows\\wceload.exe"
>>
>> Dim programName As String = "\" + programPath + "\"
>>
>>
>>
>> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles MyBase.Load
>>
>> Process.Start(programName, argName)
>>
>> End sub
>>
>>
>>
>> The programName, argName in a messagebox looks like this:
>>
>> \\windows\\wceload.exe\ \/noaskdest /noui \Storage Card\\pprofile.cpf\
>>
>> Which when I run the silly app I get a Win32 error so....it's probably as
>> bad as it looks....
>>
>>
>>
>>
>>
>>
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CreateProcess Harry Simpson Microsoft Dot NET Compact Framework 5 24th Jul 2008 07:15 PM
CreateProcess =?Utf-8?B?WXVudXMgQXRtYWNh?= Microsoft Dot NET Compact Framework 1 16th Mar 2005 03:31 PM
Re: CreateProcess Paul G. Tobey [eMVP] Microsoft Dot NET Compact Framework 0 8th Mar 2005 03:02 PM
Using CreateProcess...Help!! =?Utf-8?B?Y3Jhbmtlcg==?= Microsoft VB .NET 1 9th Feb 2004 09:52 PM
CreateProcess Stefano Camaiani Microsoft VB .NET 5 12th Oct 2003 02:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:45 AM.