[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to Get Parent process's Handle ??

Posted on 1998-06-04
1
Medium Priority
?
1,091 Views
Last Modified: 2013-12-03
Hi All,

I am developing multithreaded / multiprocess application. I am invoking couple of processes  from my primary thread. I want to pass Handle of my parent process to my child process(Not as parameter). I am usaing CreatProcess() function to create a new process. So is there anyway through which I can pass parent's process handle to this new process.???
0
Comment
Question by:dipesh042997
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
kinkajou earned 40 total points
ID: 1406932
dipesh,

There are several ways to send a parent process handle to a child process. The easiest way that comes to mind is to save the parent handle and pass it as a command line parameter to the child process. Then, in the child process,  parse the command line for your handle. Another way includes making the handle an environment variable; the child inherits the parents environment vars. And finally, you could make a shared file or memory region that both could access and put the handle there.

Good Luck!

Kinkajou
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question