473,499 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Vector Class Help!....

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!...
--
Eric Miller
Oct 31 '05 #1
2 2184
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" <Er**@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
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!...
--
Eric Miller

Oct 31 '05 #2
Yea, that did it... thank!...
--
Eric Miller
"Atul" wrote:
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" <Er**@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
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!...
--
Eric Miller


Oct 31 '05 #3

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

Similar topics

0
2511
by: Alfredo | last post by:
Hello everybody I have a problem as a newbie in using beans and I hope someone out there can help me with this. I have a jsp-page that use BeanClass. Somewhere in the jsp code there is the...
8
2076
by: ding feng | last post by:
I am a beginner. So this question could be very stupid. Would anyone help me to solve this problem? A formatted txt file is read. Then i need to look into a vector who is a member of a class to...
9
3372
by: J. Campbell | last post by:
I'm comfortable with arrays from previous programming, and understand the advantages of c++ vectors...I just don't understand how to use them :~( Can you help me to use a vector<string> in the...
2
251
by: Eric | last post by:
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...
11
1894
by: Brian | last post by:
Dear Programmers, I have a class with a pointer to an array. In the destructor, I just freed this pointer. A problem happens if I define a reference to a vector of this kind of class. The...
1
3053
by: krunalbauskar | last post by:
Hi, Explicit instantiation of STL vector demands explicit instantiation of all the templates it using internally. For example - <snippet> #include <iostream> #include <vector>
2
3076
by: brasewel | last post by:
Hi guys, I'm getting an error i cannot figure. Here is my code Header file ------------------------------------------------------------------------------------------- #ifndef Clock_H #define...
3
3240
by: mersinli | last post by:
Hello; I will use standard library vectors and implement simple map coloring algorithm. The goal of a map coloring problem is to color a map so that regions sharing a common border have...
0
1441
by: doobybug | last post by:
Hi all, I really need your help! I am new to java and have some problems with my code. I have a program which inputs questionnaires and creates an object for each questionnaire. These objects are...
0
7007
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
7171
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
7220
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...
1
6893
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
7386
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
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.