473,623 Members | 2,453 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 2203
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
2532
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
2083
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, I get string j which could be a member of the above vector. This vector is a private member of...
9
3386
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
1908
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 correctly. Attached is my program. Thanks for your help. Regards,
1
3070
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
3091
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
3255
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 neighbor vector: Countries 1 2 3 4 1 - T F T 2 ...
0
1451
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 class. I want to make a class that prints the questionnaires in alphabetical order (which is already...
0
8165
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8670
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8326
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7150
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4074
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2602
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
1
1778
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1473
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.