473,387 Members | 3,684 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,387 software developers and data experts.

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 2177
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.