Hi, ich hab folgendes Problem:
habe eine Klasse "Account", die als reiner Datencontainer Dient ( Name, user Passwort usw.)
Dnn habe ich eine Klasse "Properties", die diese Accounts erstellen soll und als List<T> objekt returnen soll.
Ich bekomme aber nur Fehlermeldungen...
Hier die Properties.h
und hier die Properties.cpp
und die Fehler:
wer kann mir sagen, was ich falsch gem8 habe ?
Danke im voraus
ok, wie das immer so ist, hab ich dann doch noch ne lösung ergooglen können... Properties.cpp muss so aussehen :
und die Properties.h :
habe eine Klasse "Account", die als reiner Datencontainer Dient ( Name, user Passwort usw.)
Dnn habe ich eine Klasse "Properties", die diese Accounts erstellen soll und als List<T> objekt returnen soll.
Ich bekomme aber nur Fehlermeldungen...
Hier die Properties.h
Code:
#pragma once
#include "Account.h"
using namespace System;
using namespace System::Collections::Generic;
ref class Properties
{
//List<Account^> ^L_Account;
public:
Properties(void);
//Getter´s
List<Account^> getAccount();
//Setter´s
void setAccount (List<Account^>);
};
und hier die Properties.cpp
Code:
#include "StdAfx.h"
#include "Properties.h"
using namespace System;
using namespace System::Collections::Generic;
Properties::Properties(void)
{
}
//Getter´s
List<Account^> Properties::getAccount()
{
List<Account^> ^L_Account;
return ^L_Account ;
}
//Setter´s
void setAccount(List<Account^> )
{
}
und die Fehler:
Code:
1>Properties.cpp
1>.\Properties.cpp(15) : error C3192: Syntaxfehler: "^" ist kein Präfixoperator (meinten Sie "*"?).
1>.\Properties.cpp(15) : error C3073: "System::Collections::Generic::List<T>": Die Verweisklasse hat keinen benutzerdefinierten Kopierkonstruktor.
1> with
1> [
1> T=Account ^
1> ]
wer kann mir sagen, was ich falsch gem8 habe ?
Danke im voraus

ok, wie das immer so ist, hab ich dann doch noch ne lösung ergooglen können... Properties.cpp muss so aussehen :
Code:
#include "StdAfx.h"
#include "Properties.h"
using namespace System;
using namespace System::Collections::Generic;
Properties::Properties(void)
{
}
//Getter´s
List<Account^>^ Properties::getAccount()
{
List<Account^> ^L_Account;
return L_Account ;
}
//Setter´s
void Properties::setAccount(List<Account^> )
{
}
Code:
#pragma once
#include "Account.h"
using namespace System;
using namespace System::Collections::Generic;
ref class Properties
{
//List<Account^> ^L_Account;
public:
Properties(void);
//Getter´s
List<Account^>^ getAccount();
//Setter´s
void setAccount (List<Account^>);
};
Zuletzt bearbeitet: