473,563 Members | 2,658 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_NextReference A;
}

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

(184): error C3633: cannot define 'm_NextReferenc eA' as a member of managed
'DocumentData'
because of the presence of copy constructor
'std::vector<_T y>::__ctor' on class 'std::vector<_T y>'
with
[
_Ty=int
]
and
[
_Ty=int
]
and
[
_Ty=int
]
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\vector(327) : see declaration of 'std::vector<_T y>::__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 2197
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**@discussio ns.microsoft.co m> wrote in message
news:2E******** *************** ***********@mic rosoft.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_NextReference A;
}

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

(184): error C3633: cannot define 'm_NextReferenc eA' as a member of
managed
'DocumentData'
because of the presence of copy constructor
'std::vector<_T y>::__ctor' on class 'std::vector<_T y>'
with
[
_Ty=int
]
and
[
_Ty=int
]
and
[
_Ty=int
]
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\vector(327) : see declaration of
'std::vector<_T y>::__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**@discussio ns.microsoft.co m> wrote in message
news:2E******** *************** ***********@mic rosoft.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_NextReference A;
}

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

(184): error C3633: cannot define 'm_NextReferenc eA' as a member of
managed
'DocumentData'
because of the presence of copy constructor
'std::vector<_T y>::__ctor' on class 'std::vector<_T y>'
with
[
_Ty=int
]
and
[
_Ty=int
]
and
[
_Ty=int
]
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\includ e\vector(327) : see declaration of
'std::vector<_T y>::__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
2528
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 following scriptlet: <% Vector vec=BeanClass.getStateVector();
8
2081
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 search the matched string and return this string. For example, this vector has (string1, string2, ...stringn). When the formatted txt file is read,...
9
3381
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 following compilable example instead of the string* array? Thanks, Joe #include <iostream>
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 <vector> using namespace std;
11
1899
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 destruction of the assigned memory seems to call the class destructor more than once. I don't know the reason or whether I used the vector class...
1
3066
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
3088
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 Clock_H #include <vector> #include <list>
3
3252
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 different colors In C++ I can represent the neighboring information using a 2D vector of booleans. For example, consider the following 2D...
0
1447
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 then saved in a vector which in turn is then encoded in an XML file. For all this I have made a class called MainInput. The problem is with MainOutpu...
0
7580
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8103
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6244
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5481
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5208
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2079
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 we have to send another system
0
916
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.