There is actually an error in your code:
You're redeclaring the same enum as an unmanaged one.
Try something like this:
static __value enum eEnumType_MCPP m_eEnumType_MCPP2;
--
Silviu Guea, Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.
--------------------
| From: Alan Cobb <al***********@spam.off.alancobb.spam.off.com>
| Subject: Public managed enum types in MCPP - Compiler warning
| Date: Tue, 27 Apr 2004 16:08:04 -0700
| Message-ID: <9i********************************@4ax.com>
| X-Newsreader: Forte Agent 1.92/32.572
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Newsgroups: microsoft.public.dotnet.languages.vc
| NNTP-Posting-Host: 177.119-30-64.ftth.swbr.surewest.net 64.30.119.177
| Lines: 1
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vc:36168
| X-Tomcat-NG: microsoft.public.dotnet.languages.vc
|
| Hi,
|
| In the managed C++ class below I get compile warning C4677
| from VS2003. "signature of non-private function contains
| assembly private type", even though the managed enum is
| public. I have to drop the "enum" keyword from my member
| variable declaration to keep the compiler happy.
|
| Shouldn't I technically be able to use the "enum" keyword
| without a warning?
|
| Thanks,
| Alan Cobb
|
| namespace MCPP_ClassLib1
| {
| public __value enum eEnumType_MCPP { eMem1, eMem2 };
|
| public __gc class Class_MCPP // Managed class
| {
| public:
| // The compiler likes this:
| static eEnumType_MCPP m_eEnumType_MCPP1;
|
| // The compiler gives a warning C4677 for this:
| // 'm_eEnumType_MCPP2': signature of non-private
| // function contains assembly private type
| // 'MCPP_ClassLib1::eEnumType_MCPP'
| //
| // static enum eEnumType_MCPP m_eEnumType_MCPP2;
| };
| }
|
| For reference:
|
http://msdn.microsoft.com/library/en...c.2b2b_.enumer
ation_declarations.asp
|