Nitpicking, but bear in mind that there's no such thing as an Any CPU ‘process’ 
of course. I think you meant your parent was a 64 bit process (the result of 
running an EXE built with ‘Any CPU’ on x64 hardware).




(self-nitpick: and assuming no fiddling with CORFLAGS.exe)






From: Greg Keogh
Sent: ‎Thursday‎, ‎January‎ ‎16‎, ‎2014 ‎8‎:‎30‎ ‎AM
To: ozDotNet






Folks, I knew it would work, but just in case it's of interest I can report 
that a parent Any CPU process can start a child x86 process which can Interop 
with native 32-bit DLLs.




I opened a mini WCF server with TCP binding in the child and a corresponding 
WCF client in the parent. Then the parent and child can talk to each other and 
the parent can (indirectly) pull data back from the C++ DLL down in the child 
process. This creates really good isolation, as the child process and the 
native stuff is all pushed off into its own folder and doesn't pollute the 
caller. You can see the Process parent-child relationship in procexp.




You've got to set all the ProcessStartInfo values correctly for your needs, set 
EnableRaisingEvents = true and listen to the Exited exit to know if the child 
actually exits when you request it to. The parent can exit and the child keeps 
running (like foreground Threads do). It's up to you to negotiate the lifetimes 
of the parent and child correctly.




Greg K

Reply via email to