Click here to Skip to main content
15,893,722 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Strings and other resources Pin
Nish Nishant15-Jan-06 3:54
sitebuilderNish Nishant15-Jan-06 3:54 
GeneralRe: Strings and other resources Pin
Red Stateler17-Jan-06 5:31
Red Stateler17-Jan-06 5:31 
GeneralRe: Strings and other resources Pin
Nish Nishant17-Jan-06 5:41
sitebuilderNish Nishant17-Jan-06 5:41 
Questiondebugging VC6.0 DLL from VS .NET 2003 Pin
eddyroth13-Jan-06 4:19
eddyroth13-Jan-06 4:19 
AnswerRe: debugging VC6.0 DLL from VS .NET 2003 Pin
Nish Nishant13-Jan-06 4:24
sitebuilderNish Nishant13-Jan-06 4:24 
GeneralRe: debugging VC6.0 DLL from VS .NET 2003 Pin
eddyroth13-Jan-06 4:40
eddyroth13-Jan-06 4:40 
GeneralRe: debugging VC6.0 DLL from VS .NET 2003 Pin
Nish Nishant13-Jan-06 4:48
sitebuilderNish Nishant13-Jan-06 4:48 
QuestionCopy Constructors Pin
Tom Moore13-Jan-06 1:11
Tom Moore13-Jan-06 1:11 
Hi,

I've just got Visual Studio 2005 Standard Edition and was writing a new CLR class

using this code

<br />
#using "System.dll"<br />
<br />
using namespace System;<br />
<br />
<br />
public ref class SimpleClass<br />
{<br />
public:<br />
	SimpleClass();<br />
	SimpleClass(System::String^ str,System::Int32 age);<br />
	~SimpleClass();<br />
	<br />
System::String^ GetName()  {return _str;}<br />
void  SetName(System::String^ str) {_str = str;}<br />
 System::Int32 GetAge()  {return _age;}<br />
<br />
private:<br />
	System::Int32 _age;<br />
	System::String^ _str;<br />
};<br />
<br />
SimpleClass::SimpleClass()<br />
{}<br />
<br />
SimpleClass::~SimpleClass()<br />
{}<br />
<br />
SimpleClass::SimpleClass(System::String^ str,System::Int32 age)<br />
{<br />
	_str = str;<br />
	_age = age;<br />
}<br />


then i wrote a cpp file

<br />
#include "simpleclass.h"<br />
<br />
int main()<br />
{<br />
	SimpleClass SC = gcnew SimpleClass("Bob",13);<br />
<br />
	Console::WriteLine(SC.GetAge());<br />
<br />
<br />
	return 0;<br />
}<br />


I tried two modifactions both using the new '^' handle operator and normal class by saying
SimpleClass SC = gcnew SimpleClass().

However when i tried using "gcnew SimpleClass() it came up with error, no copy constructor.

So I wrote this :
<br />
SimpleClass(const SimpleClass& rhs);<br />


and it came up with several errors.

How do you write a copy constructor in C++ 2.0 please Smile | :)

Thanks Cool | :cool:

Tom
AnswerRe: Copy Constructors Pin
Nish Nishant13-Jan-06 3:19
sitebuilderNish Nishant13-Jan-06 3:19 
GeneralRe: Copy Constructors Pin
Tom Moore14-Jan-06 11:37
Tom Moore14-Jan-06 11:37 
GeneralRe: Copy Constructors Pin
Nish Nishant14-Jan-06 17:22
sitebuilderNish Nishant14-Jan-06 17:22 
QuestionDynamically created property Pin
Soundman32.211-Jan-06 4:34
Soundman32.211-Jan-06 4:34 
AnswerRe: Dynamically created property Pin
Nish Nishant11-Jan-06 4:36
sitebuilderNish Nishant11-Jan-06 4:36 
QuestionRE: Sinh Calculator Pin
Dylan06038811-Jan-06 3:39
Dylan06038811-Jan-06 3:39 
AnswerRe: RE: Sinh Calculator Pin
Nish Nishant11-Jan-06 3:52
sitebuilderNish Nishant11-Jan-06 3:52 
Question[C++.NET] Using class of a VC6 and none-MFC DLL Pin
ChocoSoft10-Jan-06 21:56
ChocoSoft10-Jan-06 21:56 
AnswerRe: [C++.NET] Using class of a VC6 and none-MFC DLL Pin
Nish Nishant11-Jan-06 3:50
sitebuilderNish Nishant11-Jan-06 3:50 
AnswerRe: [C++.NET] Using class of a VC6 and none-MFC DLL Pin
ChocoSoft12-Jan-06 3:15
ChocoSoft12-Jan-06 3:15 
GeneralRe: [C++.NET] Using class of a VC6 and none-MFC DLL Pin
Nish Nishant12-Jan-06 3:31
sitebuilderNish Nishant12-Jan-06 3:31 
GeneralRe: [C++.NET] Using class of a VC6 and none-MFC DLL Pin
toxcct12-Jan-06 3:46
toxcct12-Jan-06 3:46 
GeneralRe: [C++.NET] Using class of a VC6 and none-MFC DLL Pin
Nish Nishant12-Jan-06 4:44
sitebuilderNish Nishant12-Jan-06 4:44 
GeneralRe: [C++.NET] Using class of a VC6 and none-MFC DLL Pin
ChocoSoft12-Jan-06 4:49
ChocoSoft12-Jan-06 4:49 
GeneralRe: [C++.NET] Using class of a VC6 and none-MFC DLL Pin
Nish Nishant12-Jan-06 6:36
sitebuilderNish Nishant12-Jan-06 6:36 
QuestionText Databasing Pin
LightWolf19879-Jan-06 17:46
LightWolf19879-Jan-06 17:46 
AnswerRe: Text Databasing Pin
toxcct9-Jan-06 21:58
toxcct9-Jan-06 21:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.