|
It's possible to import Office UI into C# using the Microsoft Office Toolkit, or something. That would be the way to do this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i dont want to display that in the ui. i just want to call the solver with values as parameter and i am expecting the output.
can i use this as dll?
My small attempt...
|
|
|
|
|
How to create folder with c# for a active directory user in homedrive.
jayesh talsaniya
|
|
|
|
|
Environment.SpecialFolder.Personal;
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Thanx for reply.
Please, Can i have some more hint on how to create homedrive folder for a activedirectory user.
thank you.
jayesh
|
|
|
|
|
hi,
I've got this part of code
<br />
public delegate void DellagacjaVoid();<br />
<br />
public void pingowanie()<br />
{<br />
if (this.InvokeRequired)<br />
{<br />
DellagacjaVoid delegacja = new DellagacjaVoid(pingowanie);<br />
this.Invoke(delegacja);<br />
}<br />
<br />
string sciezka = "plik.txt";<br />
if (File.Exists(sciezka))<br />
{ <br />
FileStream fs = new FileStream(sciezka, FileMode.Open, FileAccess.Read);<br />
StreamReader reader = new StreamReader(fs);<br />
string linia = reader.ReadLine();<br />
linia = null;<br />
while ((linia=reader.ReadLine()) != null)<br />
{<br />
try<br />
{ <br />
richTextBox1.Text += linia + "\n";<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
}<br />
}<br />
reader.Close();<br />
}<br />
}<br />
<br />
private void button1_Click(object sender, EventArgs e)<br />
{<br />
Thread watek = new Thread(pingowanie);<br />
watek.Start(); <br />
}<br />
the thing is that the content i read to the richtextbox alright, as many lines as there are in the txt file but also I get as many exeptions as number of lines with the text like this:
http://img444.imageshack.us/img444/6911/88524168zy6.png[^]
can someone help?
|
|
|
|
|
You cannot set the Text property of your rich textbox from another thread as the one it was created on. You should first create the content string (you're better of using the StringBuilder class by the way, it's faster) and then assign it to the rich text box's Text property from the thread it was created on.
Standards are great! Everybody should have one!
|
|
|
|
|
hi,
to access the object's properties created in one thread from another, you have to define a delegate for that function and invoke that method from the new thread. then only you will be able to change the properties.
example below:
private delegate void UpdateUIDelegate(string text);<br />
private void UpdateUI(string text)<br />
{<br />
if(InvokeRequired)<br />
{<br />
this.Invoke(new UpdateUIDelegate(UpdateUI),new object[] {text});<br />
return;<br />
}<br />
this.textbox1.Text= text;<br />
}
you can now call the "UpdateUI" function from the new thread
this is one of the methods of making your code thread safe.
hope this helps
regards
|
|
|
|
|
I have been looking for many article about writing text file but all of those they talking about window form but I'm looking for web application article and I don't find any.
I would like to get help from anybody who knows how to do this work.
And also I have a question.
-Can I use streamwriter or streamreader with web application?
Please help me give up with this problem.
Thank you for all reply,
Junior boy.
-- modified at 3:44 Monday 21st May, 2007
junior boy
|
|
|
|
|
It's irrelevant that it's a web app, assuming you want to write a text file on the server. On the client, all you can do is have someone download a text file, you can't just write one without the user asking for it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You mean I have to create a text file and keep it on the server first and then if user want that file just download from the server and I can't write the information directly to client,right?
And please give me some keyword for looking the ideal of this.
Thank you very much.
junior boy
|
|
|
|
|
You can do that, then you just need to provide a link. You can also set the mime type and stuff a file into a response, using the Response object.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi!
I do have strange crashes on an application.
An App, consisting of an .Net1.1/C#-Exe and some .Net1.1-DLLs is doing some communication over RS232 and executing some Threads/UserWorkItems. It processes some Jobs, that are started by commands that arrive over RS232.
At some point, when the app is running maybe about 45mins to 1.5 hours it disapperard without any sign. I put in a lot of logging (Status of the system, exceptions and so on), so there should be nearly no line of code outside a try/catch. Every try/catch-block has it´s own logging.
I even put a try/catch around the "Application.Run(...)" inside my main-routine. Logging before and after this application start should show me, what happened. No result: the app doesn´t even write the logging at the very end of the main-routine where any exception should be caught.
But when the app crashes i do not get any more logging-entry or event this nice "MS-Send Information on crash"-Window. It´s just gone, just if anyone killed the process with the task-manager.
And what the stangest thing is: it works fine for hours and hours on an simulation-worksstation, but crashes on the machine it should finally run on.
Who can help me? Any ideas are welcome!
Thanx a lot!
J.
|
|
|
|
|
Hi,
Assuming your application is multithreaded, its very much possible that your crash issue is related with thread synchronization.
You look for possible thread synchronization problem in your code. Also you can implement a debug writer to a file system which will write the debug message to a physical file (Debug file). When your application crashes, you can go through the file and find out what is the last few lines of code excecuted while crash occured.
Manoj
Never Give up
|
|
|
|
|
I do have a debug-writer. But i always get different code-lines with that.
The thread-sync is done by events, that are sent between the threads (this is because of the architecture and the needs of the app). Each class takes handles events it receives.
What i got a few minutes ago was a "ExecutionEngineException" while closing a Logging-FileStream.
Maybe this could be a hint on where the error might be...
|
|
|
|
|
|
Try this[^]
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
I am a C# beginner.
when attribute changed,I want to start a event for response.
like VisibleChanged event.
I mastery is bad about event and delegate,please guidance.
Thanks very much.
|
|
|
|
|
Use a delegate and add it to the event for your object.
TextBox txt = new TextBox();<br />
txt.VisibleChanged += new EventHandler(TextBox_VisibilityChanged);<br />
<br />
public void TextBox_VisibilityChanged(object sender, EventArgs e)<br />
{<br />
}
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
My Class :
public class MyClass
{
private int stauts =0;
public int Stauts
{
get{return status;}
set{status = value;}
}
}
How write a event associate "Stauts" when "Stauts" changed.
thanks.
|
|
|
|
|
hi,
you could try the following:
public class MyClass
{
private int stauts =0;
public delegate void MyEventHandler(object obj);
public event MyEventHandler OnStatusChange;
public int Stauts
{
get{return status;}
set
{
status = value;
OnStatusChange(this);
}
}
}
for more information read http://www.codeproject.com/csharp/eventarguments.asp[^]
regards
|
|
|
|
|
why "MyEventHandler" does not have "EventArgs" parameter?
|
|
|
|
|
Call the event hanlder inside the body of the set{ } statement.
|
|
|
|
|
the declared sentence: "public event StatusHandler statusChanged",
where should i write it?
thanks.
|
|
|
|
|
I have a very basic upload/download application. The app uses a select statement to download and a insert statement to upload. The reason I include those is because I am not sure how to get a progress report from them, ie completion percentage. I may be uploading upward of 100megs and don't want the user to just sit there waiting. I have tested a 5meg file and it takes about 3 minutes to upload and does so correctly, but the user has no idea what is going on.
How do I get progress of the SQL read/write so I can update my progress bar?
Thanks in advance!
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|