Hello All Friends,

I found an error on above mention code (Found error on red/Bold code).

namespace wyUpdate
{
	using namespace System;
	using namespace System::Collections::Generic;
	using namespace System::IO;
	using namespace System::Runtime::InteropServices;
	using namespace System::Threading;
	using namespace Microsoft::Win32::SafeHandles;

        public ref class PipeServer
	{	
		public:
		[StructLayoutAttribute(LayoutKind::Sequential)]
		value class SECURITY_DESCRIPTOR
		{
			public:
			System::Byte revision;
			System::Byte size;
			short control;
			IntPtr owner;
			IntPtr group;
			IntPtr sacl;
			IntPtr dacl;
		};


		public:
		void Start(System::String ^pipename)
		{
			PipeName = pipename;

			[B]listenThread = gcnew Thread(ListenForClients);[/B]
			listenThread->Start();
			Running = true;
		}


		public:
		void ListenForClients()
		{
		   SECURITY_DESCRIPTOR ^sd = gcnew SECURITY_DESCRIPTOR();
		}

	};	
}

Error is mention below:
Error 1
error C3867: 'wyUpdate:: PipeServer::ListenForClients': function call missing argument list; use '&wyUpdate:: PipeServer::ListenForClients' to create a pointer to member

Please help me to solve it.

Thanks & regards,

Rupendra

Did you try what the error message suggested to do? It's telling you you needed the pointer and how to add the & to the function to do it (I have limited experience with threads under C++/CLI but it seems logical as this function pointer is like a delegate).

When I try mention below code suggest by you:

listenThread = gcnew Thread(&ListenForClients);

I found mention below error:

error C2276: '&' : illegal operation on bound member function expression

Try it exactly the way the compiler is telling you with the namespace and class qualifiers. Otherwise I am not sure.

This article has been dead for over six months. Start a new discussion instead.