473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Managed VC++ compiler error

He everybody,

I am geting compiler error when trying to subclass managed C++ class. Here
is a code sample and the error itself.
Error:
error C2614: 'MDMessageNet::MDPing' : illegal member initialization:
'Object' is not a base or member
This diagnostic occurred in the compiler generated function
'MDMessageNet::MDPing::MDPing'

Code:
public __abstract __gc class MDBaseHdr
{
public:
MDBaseHdr(void);
// copy constructor
MDBaseHdr(MDBaseHdr & rhdr);

virtual ~MDBaseHdr(void);

virtual void Serialize( MDMessageNet::BinaryWriter* writer );
virtual void Deserialize( MDMessageNet::BinaryReader* reader );

__property void set_Size(int value) { header.bits.size = (value > 0) ?
value : 0; }
__property void set_Type(short value) { header.bits.type = value; }

private:
MD_MESSAGE_HDR header;
};

public __gc class MDPing : public MDBaseHdr
{
public:
MDPing();
virtual ~MDPing(void);

virtual void Serialize( MDMessageNet::BinaryWriter* writer );
virtual void Deserialize( MDMessageNet::BinaryReader* reader );

protected:
virtual void Init();

};

Thanks...

Nov 17 '05 #1
1 921
Guys,
I found the problem. MDPing class did't have copy constructor.

"Alex" wrote:
He everybody,

I am geting compiler error when trying to subclass managed C++ class. Here
is a code sample and the error itself.
Error:
error C2614: 'MDMessageNet::MDPing' : illegal member initialization:
'Object' is not a base or member
This diagnostic occurred in the compiler generated function
'MDMessageNet::MDPing::MDPing'

Code:
public __abstract __gc class MDBaseHdr
{
public:
MDBaseHdr(void);
// copy constructor
MDBaseHdr(MDBaseHdr & rhdr);

virtual ~MDBaseHdr(void);

virtual void Serialize( MDMessageNet::BinaryWriter* writer );
virtual void Deserialize( MDMessageNet::BinaryReader* reader );

__property void set_Size(int value) { header.bits.size = (value > 0) ?
value : 0; }
__property void set_Type(short value) { header.bits.type = value; }

private:
MD_MESSAGE_HDR header;
};

public __gc class MDPing : public MDBaseHdr
{
public:
MDPing();
virtual ~MDPing(void);

virtual void Serialize( MDMessageNet::BinaryWriter* writer );
virtual void Deserialize( MDMessageNet::BinaryReader* reader );

protected:
virtual void Init();

};

Thanks...

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Bredal Jensen | last post by:
I want to port my MFC (VC++6) application to manageg VC ++. 7. I want to do this because some things are much better done with C#. So i could write a C# class and use in my VC++ code as Languague...
1
by: Omid Hodjati | last post by:
Hi All, I have an old unmanaged code written in C++ 6.0. This is a time critcal, CPU bound application. I have deciede migrate this application to managed world and VC++ 7.0. The first step was...
1
by: Eric Twietmeyer | last post by:
Hello, I'm starting to investigate cs, managed c++ and interoperating with a very large unmanaged code base. We are going to use Windows Forms (written in cs) to replace our old fashioned GUI. ...
7
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
5
by: Alan Cobb | last post by:
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...
4
by: Ana Farcas via .NET 247 | last post by:
hello, i have an old library i need to port to .net. the old library is written in visual c++ 6.0 and uses templated classes. if i compile the library (after having gone through the conversion...
2
by: Michael Braitmaier | last post by:
I have a quite severe problem. I am trying to compile a C++ library initially written for VC++ 6. To make the library available for .NET languages I want to compile the library as managed C++...
6
by: guxu | last post by:
I have a managed C++ code which calls some methods in unmanaged C++ DLL. In my unmanaged DLL, I have a PROTECTED virutal function in a base class and derived class has a PRIVATE function which...
1
by: pikulsky | last post by:
There is a managed C++ class (ManagedClass) defined in one library (TestMCpp.dll), it has a method (funcTemplate) with template native type (NativeTemplate<int>). This library is built without any...
9
by: raylopez99 | last post by:
microsoft.public.dotnet.languages.vc Please comment on the following code fragment. Note the comments "Why"? Particularly, (1) why does referencing and dereferencing a pointer give the same...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.