Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have the following managed class
namespace Managed_DLL
{
public ref class AController
{
    public:
        delegate void didChangeListenerStatus(tListenerStatus status);
....
}
// header file
#if defined(_MANAGED)
namespace Managed_DLL
{
#define ENUMKEYWORD public enum
#else
#define ENUMKEYWORD typedef enum
#endif

ENUMKEYWORD tListenerStatus
{
    kListenerStopped,
    kListenerRunning,
    kListenerFailed
} ;

}

I have defined the _MANAGED in the dll preprocessor defines
In C# app I have defined the didChangeListenerStatus in one of classes as

C#
using Managed_DLL
....
public void didChangeListenerStatus(tListenerStatus status)
        {
            Console.WriteLine(" didChangeListnerStatus called");
        }

When I compile the C# app it gives the following error
VB
Error   4   'tListenerStatus' is inaccessible due to its protection level  

MSIL
Error   3   Inconsistent accessibility: parameter type 'tListenerStatus' is less accessible than method 'ADemo.ViewController.didChangeListenerStatus(tListenerStatus)

VB
Error   6   The type or namespace name 'tListenerStatus' could not be found (are you missing a using directive or an assembly reference?)  



Please help. Thanks in advance.
Posted
Updated 22-Mar-11 20:59pm
v2

try this code.
C#
public  ENUMKEYWORD tListenerStatus
{
    kListenerStopped,
    kListenerRunning,
    kListenerFailed
} ;

by default all class are private.
 
Share this answer
 
Why do you repeat questions? See my answer to your identical Question.

—SA
 
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