Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Convert::ChangeType i VC++

[es] :: .NET :: Convert::ChangeType i VC++

[ Pregleda: 3497 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Acid.Reconected
Nikola Milanovic
Cacak

Član broj: 32821
Poruke: 20
*.smin.sezampro.yu.



Profil

icon Convert::ChangeType i VC++11.09.2004. u 17:00 - pre 238 meseci
Pozdrav svima.

Imam problem kod koriscenja Convert::ChangeType

Imam treeView sa nekoliko Node-ova. Svake node treba da ima neke dodatne informacije koje sam smestio u Tag svojstvo:
Code:

public: ref struct Files
             {
        System::String FullName;
        System::String Note;
    };
...
System::Windows::Forms::TreeNode t;
t=this->treeView1->Nodes->Add("Ime");
Files info;
info->FullName="FullName";
t->Tag=info;
//do sada sve radi OK


E problem nastaje kada iz Tag svojstva hocu da uzemem FullName?
Probao sam sa ChangeType ali nema pojma, gledao sam po netu i opet nista..

Da li neko ima neku ideju?
HVALA>
Hide me away from danger
 
Odgovor na temu

havramm
Miroslav Havram
Software Developer / Engineer
Beograd

Član broj: 4603
Poruke: 255
212.62.55.*



Profil

icon Re: Convert::ChangeType i VC++11.09.2004. u 17:39 - pre 238 meseci
Code:
//t je tipa Node*

String* tag = __try_cast<String*>(Convert::ChangeType(t->Tag, __typeof(String)));

Ne poznajem bas najbolje managed VC++, pa ako neko ima nesto da doda, neka me isparavi.
If it's a girl then they're gonna call it Sigourney, after an actress. If it's a boy, then they're gonna call it Rodney, after Dave!
 
Odgovor na temu

Acid.Reconected
Nikola Milanovic
Cacak

Član broj: 32821
Poruke: 20
*.smin.sezampro.yu.



Profil

icon Re: Convert::ChangeType i VC++16.09.2004. u 09:47 - pre 238 meseci
probao sam, ali pri kompajliranju dobijam gresku:
"error C4980: '__try_cast' : use of this keyword requires /clr:oldSyntax command line option" ?>?>?
Hide me away from danger
 
Odgovor na temu

havramm
Miroslav Havram
Software Developer / Engineer
Beograd

Član broj: 4603
Poruke: 255
212.62.55.*



Profil

icon Re: Convert::ChangeType i VC++16.09.2004. u 11:25 - pre 238 meseci
Koji VS ti koristis? Da nije mozda VC++ 2005 Express Beta (posto vidim da imas instaliranu beta verziju Framework-a 2.0)? Meni u VS.NET 2003 to ne prijavljuje i sve odradi korektno.
If it's a girl then they're gonna call it Sigourney, after an actress. If it's a boy, then they're gonna call it Rodney, after Dave!
 
Odgovor na temu

Dragi Tata
Malo ispod Kanade

Član broj: 1958
Poruke: 3906
66.228.70.*



+6 Profil

icon Re: Convert::ChangeType i VC++16.09.2004. u 13:04 - pre 238 meseci
Ma da. Meša staru i novu sintaksu.
 
Odgovor na temu

[es] :: .NET :: Convert::ChangeType i VC++

[ Pregleda: 3497 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.