Error C3379:a nested class cannot have an assembly access

Hello All,

I am tired to found mention below code solution, please help me to solve it, I am new in VC++.Net.

I got error when I put the code in my cpp Class file. The code is mention blow (Error code is mention in bold Red).



#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;

public ref class PipeServer
{
public:
[DllImport("kernel32.dll", SetLastError = true)]
static SafeFileHandle ^CreateNamedPipe(System::String ^pipeName, System::UInt32 dwOpenMode, System::UInt32 dwPipeMode, System::UInt32 nMaxInstances, System::UInt32 nOutBufferSize, System::UInt32 nInBufferSize, System::UInt32 nDefaultTimeOut, IntPtr lpSecurityAttributes);

public:
[DllImport("kernel32.dll", SetLastError = true)]
static int ConnectNamedPipe(SafeFileHandle ^hNamedPipe, IntPtr lpOverlapped);

[DllImport("kernel32.dll", SetLastError = true)]
static bool DisconnectNamedPipe(SafeFileHandle ^hHandle);

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



Please help me to solve the problem.

Thanks in advance,

Rupendra
Topic archived. No new replies allowed.