Accessing Windows handle

  • Thread starter Thread starter its_me_here
  • Start date Start date
I

its_me_here

Guest
I have an event handle object declared in one class. I need that handle to be accessible in another class.

class A
{

private:
HANDLE m_hEvent;

void DoSomthing()
{
...
...
SetEvent(m_eEvent);
}
}


class B
{

void Do()
{
Initialize the handle and wait for the event to set
}
}
Is it OK to declare he handle a friend of the second class and use it? Is it a good design to use handles like this? Because I have such a a scenario .Is there any other method?

Continue reading...
 
Back
Top