![]() |
|
#1
|
|||
|
|||
Overloading operator = in a managed classHi,
I am using Visual Studio .NET 2003. I created a public __gc class PC (VS says it is a managed class because of this __gc = garbage collection) I still don't understand why I have to add all that but anyway I am trying to write a code for the operator = and it doesn't let me overload it with the usual CPP / C++ / C Code:
it says in managed classes use CPP / C++ / C Code:
when I do this CPP / C++ / C Code:
Does anyone know how I can overload the = operator? Thank you, Gix |
|||
|
#2
|
|||
|
|||
Re: Overloading operator = in a managed classQuote:
Use op_Assign From msdn: http://msdn2.microsoft.com/en-us/lib...00(vs.71).aspx Regards, Dave |
|
#3
|
|||
|
|||
Re: Overloading operator = in a managed classThanks...
I did this but now I humbled upon a linker error!!! Thank you anyway, Gix |
|
#4
|
||||
|
||||
Re: Overloading operator = in a managed classI moved the thread to the .NET Forum.
|
|
#5
|
|||
|
|||
Re: Overloading operator = in a managed classQuote:
Post the code. Tell us how you are compiling it. If it's from a GUI, what are the project settings? If it's from a command line, what are the options? I used the __gc stuff in a previous version of .NET (just experimenting --- never did any serious development). With Visual C++ 2005 Express (the free download and the only thing that I can try it with now) I have to use a command-line option /clr:oldSyntax to make it go. Regards, Dave |
|
#6
|
|||
|
|||
Re: Overloading operator = in a managed classThanks for all the help, I solved that problem but now I have posted my biggest one http://www.gidforums.com/t-12440.html
It'll be great if you can help again, Gix |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Introduction to .NET | LuciWiz | .NET Forum | 5 | 09-Aug-2007 04:53 |
| Box Class, need help again :( | TransformedBG | C++ Forum | 7 | 13-Nov-2006 15:11 |
| C++ class -- Please help | vnca_1 | C++ Forum | 3 | 14-Jun-2006 12:31 |
| a tester class and then some. | postage | Java Forum | 1 | 06-May-2006 15:48 |
| Error C2146: syntax error : missing ',' before identifier 'C4' | mattchew008 | C++ Forum | 2 | 19-Dec-2004 06:06 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The