int retValue;
string Application = Environment.GetEnvironmentVariable("windir") +
@"\Notepad.exe";
string CommandLine = @" c:\boot.ini";
Doghole.MKernel32.PROCESS_INFORMATION pInfo = new
Doghole.MKernel32.PROCESS_INFORMATION();
Doghole.MKernel32.STARTUPINFO sInfo = new
Doghole.MKernel32.STARTUPINFO();
Doghole.MKernel32.SECURITY_ATTRIBUTES pSec = new
Doghole.MKernel32.SECURITY_ATTRIBUTES();
Doghole.MKernel32.SECURITY_ATTRIBUTES tSec = new
Doghole.MKernel32.SECURITY_ATTRIBUTES();
pSec.nLength = Marshal.SizeOf(pSec);
tSec.nLength = Marshal.SizeOf(tSec);
//Open Notepad
retValue = Doghole.MKernel32.CreateProcess(Application,Comman dLine,
ref pSec,ref tSec,false,Doghole.MWinBase.NORMAL_PRIORITY_CLASS,
null,null,ref sInfo,out pInfo); // <- error here
Error message:
Additional information: Can not marshal parameter #10: The type definition
of this type has no layout information. 1 3521
Hi,
Why are you doing that?
Did you tried the Process.Start() method ? It's in System.Diagnostic.
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"afatdog" <af********@yeah.net> wrote in message
news:u2****************@TK2MSFTNGP10.phx.gbl... int retValue; string Application = Environment.GetEnvironmentVariable("windir") + @"\Notepad.exe"; string CommandLine = @" c:\boot.ini"; Doghole.MKernel32.PROCESS_INFORMATION pInfo = new Doghole.MKernel32.PROCESS_INFORMATION(); Doghole.MKernel32.STARTUPINFO sInfo = new Doghole.MKernel32.STARTUPINFO(); Doghole.MKernel32.SECURITY_ATTRIBUTES pSec = new Doghole.MKernel32.SECURITY_ATTRIBUTES(); Doghole.MKernel32.SECURITY_ATTRIBUTES tSec = new Doghole.MKernel32.SECURITY_ATTRIBUTES(); pSec.nLength = Marshal.SizeOf(pSec); tSec.nLength = Marshal.SizeOf(tSec);
//Open Notepad retValue = Doghole.MKernel32.CreateProcess(Application,Comman dLine, ref pSec,ref tSec,false,Doghole.MWinBase.NORMAL_PRIORITY_CLASS, null,null,ref sInfo,out pInfo); // <- error here
Error message: Additional information: Can not marshal parameter #10: The type definition of this type has no layout information. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
by: david.humpherys |
last post by:
os:winnt
python2.3.2
I have a exe that dumps info to the command line. I want to run this
process and capture the stdout into a file. I think i'm close... any
help appreciated.
dh...
|
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,...
|
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...
|
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,...
|
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...
|
by: Paul Schenk |
last post by:
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&,...
|
by: itmanager |
last post by:
I am trying to create a process at a particular set of coordinates (for
example 1,1) but the CreateProcess api seemingly ignores the settings in the
dwX and dwY properties of the STARTUPINFO...
|
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...
|
by: ngxfer001 |
last post by:
HI Experts,
I am trying to learn VS Setup Project, the problem I experience now
is, I have written a C++ program to register all my DirectShow filter
by CreateProcess method.
Q1: the reason I...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |