Hello all friend.
I have some problem in mention below code and I got an error from it.
#include "stdafx.h"
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;
/// <summary>
/// Allow pipe communication between a server and a client
/// </summary>
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:
[StructLayout(LayoutKind::Sequential)]
value class SECURITY_ATTRIBUTES
{
public:
int nLength;
IntPtr lpSecurityDescriptor;
int bInheritHandle;
};
private:
literal System::UInt32 SECURITY_DESCRIPTOR_REVISION = 1;
public:
ref class Client
{
public:
SafeFileHandle ^handle;
FileStream ^stream;
};
Thread ^listenThread;
static initonly List<Client^> ^clients = gcnew List<Client^>();
public:
void Start(System::String ^pipename)
{
PipeName = pipename;
[B][COLOR="red"]listenThread = gcnew Thread(ListenForClients);[/COLOR][/B]
listenThread->Start();
Running = true;
}
public:
void ListenForClients()
{
SECURITY_DESCRIPTOR ^sd = gcnew SECURITY_DESCRIPTOR();
}
};
}
Error is :
error C3867: 'wyUpdate::PipeServer::ListenForClients': function call missing argument list; use '&wyUpdate::PipeServer::ListenForClients' to create a pointer to member
But when I use mention below code instead of it:
listenThread = gcnew Thread(&ListenForClients);
I got mention below error:
error C2276: '&' : illegal operation on bound member function expression
Please help me to solve it.
Thank you in advance,
Rupendra


Sign In
Create Account

Back to top









