R
Ryan Ramsey
I currently have an RTF file added to my project as an embedded resource.
I am then using the following code to read it into a richtextbox:
Stream stream =
this.GetType().Assembly.GetManifestResourceStream("DKPCalc.doc.rtf");
if (stream != null) {
StreamReader sr = new StreamReader(stream);
richTextBox1.LoadFile(stream, RichTextBoxStreamType.RichText);
sr.Close();
}else
MessageBox.Show("Could not load resource.");
Whenever I try to use this, 'stream' is returned as a NULL.
do a:
Stream stream =
this.GetType().Assembly.GetManifestResourceStream("Resources/doc.rtf");
the text will be loaded in debug mode but of course fails when the app is
distributed because I don't distribute the rtf..
I have read several whitepapers on MSDN and have tried
http://msdn.microsoft.com/library/d...nsreflectionpermissionattributeclasstopic.asp
but have met no success.
Any help would be appreciated.
I am then using the following code to read it into a richtextbox:
Stream stream =
this.GetType().Assembly.GetManifestResourceStream("DKPCalc.doc.rtf");
if (stream != null) {
StreamReader sr = new StreamReader(stream);
richTextBox1.LoadFile(stream, RichTextBoxStreamType.RichText);
sr.Close();
}else
MessageBox.Show("Could not load resource.");
Whenever I try to use this, 'stream' is returned as a NULL.
do a:
Stream stream =
this.GetType().Assembly.GetManifestResourceStream("Resources/doc.rtf");
the text will be loaded in debug mode but of course fails when the app is
distributed because I don't distribute the rtf..
I have read several whitepapers on MSDN and have tried
http://msdn.microsoft.com/library/d...nsreflectionpermissionattributeclasstopic.asp
but have met no success.
Any help would be appreciated.