Using Vector Class Help!....

G

Guest

I am converting my VC++ MFC to Manage C++ and I am having trouble using the
vector class.

Here is my __gc class

....other headers for System classes ....
#include <algorithm>
#include <vector>
using namespace std;

public __gc class DocumentData{
.....other variables
vector<int> m_NextReferenceA;
}

this class is used through out my program, but I get these errors:
(184): error C3633: cannot define 'm_NextReferenceA' as a member of managed
'DocumentData'

(184): error C3633: cannot define 'm_NextReferenceA' as a member of managed
'DocumentData'
because of the presence of copy constructor
'std::vector<_Ty>::__ctor' on class 'std::vector<_Ty>'
with
[
_Ty=int
]
and
[
_Ty=int
]
and
[
_Ty=int
]
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\vector(327) : see declaration of 'std::vector<_Ty>::__ctor'
with
[
_Ty=int
]
and
[
_Ty=int
]

I need to use this vector class for vital parts in my program. How do I set
this up properly to use it?....

Thanks for helping me!...
 
A

Atul

You cannot include unmanaged objects in a managed class, only pointers to
unmanaged objects.

----------------
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For .Net & ActiveX
Windows Explorer GUI Controls
&
Quick-Launch Like Appbars, MSN/Office2003 Style Popups,
System Tray Icons and Shortcuts/Internet Shortcuts
 
G

Guest

Yea, that did it... thank!...
--
Eric Miller


Atul said:
You cannot include unmanaged objects in a managed class, only pointers to
unmanaged objects.

----------------
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For .Net & ActiveX
Windows Explorer GUI Controls
&
Quick-Launch Like Appbars, MSN/Office2003 Style Popups,
System Tray Icons and Shortcuts/Internet Shortcuts
----------------



Eric said:
I am converting my VC++ MFC to Manage C++ and I am having trouble using the
vector class.

Here is my __gc class

...other headers for System classes ....
#include <algorithm>
#include <vector>
using namespace std;

public __gc class DocumentData{
....other variables
vector<int> m_NextReferenceA;
}

this class is used through out my program, but I get these errors:
(184): error C3633: cannot define 'm_NextReferenceA' as a member of
managed
'DocumentData'

(184): error C3633: cannot define 'm_NextReferenceA' as a member of
managed
'DocumentData'
because of the presence of copy constructor
'std::vector<_Ty>::__ctor' on class 'std::vector<_Ty>'
with
[
_Ty=int
]
and
[
_Ty=int
]
and
[
_Ty=int
]
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\vector(327) : see declaration of
'std::vector<_Ty>::__ctor'
with
[
_Ty=int
]
and
[
_Ty=int
]

I need to use this vector class for vital parts in my program. How do I
set
this up properly to use it?....

Thanks for helping me!...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top