CreateProcess with 10 arguments - where to find it?

F

Freestyler

at http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=88 I've found a
function listed below.I've added OpenNETCF.WinAPI library. The proof is that
I can seeOpenNETCF.WinAPI.dll in my programs directory on PocketPC. But
still "'CreateProcess' does not exist in the class or namespace " The only
CreateProcess method i've found is inOpenNETCF.WinAPI.Core, but it takes 2
arguments.Whats wrong?RegsFredListing:public static string
GetSerialNumber(){ const string m_strAssetDataFile =
@"\Windows\cpqAssetData.dat"; System.IO.FileStream fs = new
System.IO.FileStream(m_strAssetDataFile,System.IO.FileMode.Open); try {
if(File.Exists(m_strAssetDataFile) == false) { ProcessInfo pi = new
ProcessInfo(); byte [] si = new byte[128];
CreateProcess(@"\Windows\CreateAssetFile.exe", null, IntPtr.Zero,
IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, si, pi); } byte []
m_bytAssetData = new byte[5216];
fs.Read(m_bytAssetData,0,m_bytAssetData.GetUpperBound(0)); return
System.Text.UnicodeEncoding.Unicode.GetString(m_bytAssetData,10,24); }
catch(Exception ex) { return ex.Message; } finally { fs.Close(); fs =
null; } }
 
R

Rich Hanbidge [MSFT]

I don't follow exactly what you are doing, can you please clarify? Are you
getting a run-time error or a compile time error?

Cheers,
Rich

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Freestyler" <[email protected]>
| Subject: CreateProcess with 10 arguments - where to find it?
| Date: Fri, 8 Aug 2003 16:21:05 +0200
| Lines: 20
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: slw.softlab.com.pl 213.25.25.101
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:30494
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| at http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=88 I've found a
| function listed below.I've added OpenNETCF.WinAPI library. The proof is
that
| I can seeOpenNETCF.WinAPI.dll in my programs directory on PocketPC. But
| still "'CreateProcess' does not exist in the class or namespace " The only
| CreateProcess method i've found is inOpenNETCF.WinAPI.Core, but it takes 2
| arguments.Whats wrong?RegsFredListing:public static string
| GetSerialNumber(){ const string m_strAssetDataFile =
| @"\Windows\cpqAssetData.dat"; System.IO.FileStream fs = new
| System.IO.FileStream(m_strAssetDataFile,System.IO.FileMode.Open); try {
| if(File.Exists(m_strAssetDataFile) == false) { ProcessInfo pi = new
| ProcessInfo(); byte [] si = new byte[128];
| CreateProcess(@"\Windows\CreateAssetFile.exe", null, IntPtr.Zero,
| IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, si, pi); } byte []
| m_bytAssetData = new byte[5216];
| fs.Read(m_bytAssetData,0,m_bytAssetData.GetUpperBound(0)); return
| System.Text.UnicodeEncoding.Unicode.GetString(m_bytAssetData,10,24); }
| catch(Exception ex) { return ex.Message; } finally { fs.Close(); fs =
| null; } }
|
|
|
 
F

Freestyler

I had a compile error, but changing number of arguments to 2 (others were
null) helped.
Thx.
Fred.
 

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