Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all

Below is the code in MFC which i have to convert in c#

C++
DWORD WINAPI PrtStatus()
{
	CriticalSection cs;
	DBGPRINTF(5, ("PrtStatus()\n"));

	DWORD dwRet = Status();

	return dwRet;
}


Please help me in this
Posted

1 solution

Declare this object in your class
C#
private object lockObject = new object();


C#
ushort PrtStatus()
{
  // Locks the section and releases upon scope exit.
  lock (lockObject)
  {
    Debug.WriteLine("PrtStatus()", 5);
 
    return Status();
  }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900