C (115/254)

From:Jesper Svennevid
Date:07 Apr 00 at 14:14:16
Subject:RE: Passing arguments to a new process

> Is it possible to pass arguments when creating a new process? For
> example, a function like this:
>
> void hello(int x)
> {
> // blah
> / blah
> }
>
> How would I give a value to 'x' using CreateNewProc() or CreateProc()?

There is a quite simple way of accomplishing this, by using the tc_UserData-
field in the Task-structure. Just write something like this:

void ProcessStarter(int arg_to_pass)
{

CreateNewProcTags(NP_Entry,(ULONG)NewProcess,TAG_END)))

}

void NewProcess()
{

arrived

}

This can be expanded to passing a structure or whatever you feel like
passing.



// Jesper Svennevid : jesper@fxrealm.com
Software Developer at FXRealm Studios
http://www.fxrealm.com/

------------------------------------------------------------------------
Get a NextCard Visa, in 30 seconds!
1. Fill in the brief application
2. Receive approval decision within 30 seconds
3. Get rates as low as 2.9% Intro or 9.9% Fixed APR
Apply NOW!
http://click.egroups.com/1/2646/1/_/451227/_/955113327/
------------------------------------------------------------------------