The answer to your question heavily depends on what use and you want to do.
If you are using C++/CLI that comes with VS.NET 2005, and implement managed
code, you can include <msclr\lock.h> and use the class msclr::lock. If you
are using Managed C++, you have to call the static methode Enter/TryEnter
and Exit of System::Threading::Monitor. If you are writing native code, you
have to use a Win32 API like the critical section api.
Marcus Heege
"[Yosi]" <Yo**@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
I have an application which run more than one thread at the sametime.
All those thread call same function (output function). How I lock this
function for other thread while one thread already use it.
in C# I done it by :
void output (String ff)
{
lock(this)
{
........
}
}
How to do that in VC++.Net ?