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

richTextBox.SaveFile Error

[es] :: .NET :: richTextBox.SaveFile Error

[ Pregleda: 3109 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Divjak
Vladimir Divjak
Student

Član broj: 4783
Poruke: 535
195.252.85.*



+1 Profil

icon richTextBox.SaveFile Error23.08.2006. u 09:17 - pre 215 meseci
uvek kada pokušam da pozovem ovu metodu
Code:

richTextBox1.SaveFile("code.rtf");


prijavi mi sledeći error:

Code:

An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll

Additional information: Object reference not set to an instance of an object.

The program '[3020] CodeGen.exe' has exited with code 0 (0x0).

And don't be mad at me for crying for humanity,
call it pretensions but I got good intentions,
to keep my sanity, I'm hoping, fuck, there's gotta be
an answer to their strategies and their evil inventions... ~Looptroop
 
Odgovor na temu

Csharp

Član broj: 39818
Poruke: 63
*.adsl.net.t-com.hr.



Profil

icon Re: richTextBox.SaveFile Error23.08.2006. u 10:21 - pre 215 meseci
Ćao!

Si otišao u debug i siguran si da baš tu baca tu grešku! Vidi, nešto ti nije instancirano! Mislim!


 
Odgovor na temu

Divjak
Vladimir Divjak
Student

Član broj: 4783
Poruke: 535
195.252.85.*



+1 Profil

icon Re: richTextBox.SaveFile Error23.08.2006. u 19:41 - pre 215 meseci
Da, siguran sam!
Mislim da sam na nekom stranom forumu video da je to neki bug...

Ima li neko od vas da je uspešno pozvao ovu funkciju?
Da li može da pošalje kod?

EDIT: Sad sam probao da pozovem funkciju sa malo teksta u RTB i odradila je posao.
Napominjem da moj RTB ima veliku količinu teksta u sebi ~ 120 linija.
To ne bi trebao da bude problem ali očigledno jeste...

EDIT2: BUG JE U VISIBLE PROPERTY RichTextBox. UKOLIKO JE ISTI FALSE, FUNKCIJA NE RADI!
[Ovu poruku je menjao Divjak dana 23.08.2006. u 20:57 GMT+1]

[Ovu poruku je menjao Divjak dana 23.08.2006. u 21:05 GMT+1]
And don't be mad at me for crying for humanity,
call it pretensions but I got good intentions,
to keep my sanity, I'm hoping, fuck, there's gotta be
an answer to their strategies and their evil inventions... ~Looptroop
 
Odgovor na temu

Taranto

Član broj: 67452
Poruke: 105
*.rcub.bg.ac.yu.



Profil

icon Re: richTextBox.SaveFile Error24.08.2006. u 23:59 - pre 215 meseci
Sasvim slucajno mi je to danas trebalo i uzeo sam primer iz helpa.
Bukvalno ga prekopirao, obrisao komentare i radi normalno... nisam naisao na neke problem ???

public void snimiLogFajl(RichTextBox istorija
{
SaveFileDialog saveFile1 = new SaveFileDialog();
saveFile1.DefaultExt = "*.txt";
saveFile1.Filter = "TXT Files|*.txt";

if(saveFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK &&
saveFile1.FileName.Length > 0)
{
istorija.SaveFile(saveFile1.FileName, RichTextBoxStreamType.PlainText);
}
}
 
Odgovor na temu

[es] :: .NET :: richTextBox.SaveFile Error

[ Pregleda: 3109 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

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