|
You have to download and install PIAs (Primary Interop Assemblies) for your version of MS Office from Microsoft's site.
|
|
|
|
|
Thank you. That helped me. Sorry for the delayed reply.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
I am doing a project that use UPC A barcode. I found the code to convert number to UPC A barcode and it works well. But i am having an error converting UPC A barcode to number.
Is there any to help me. I would be very grateful to You.
Thank you!!
deepak
|
|
|
|
|
hi,
there are a lot of articles related to barcodes in CP.
regards
|
|
|
|
|
i have a string that i wish to store as contents of a textfile.
i would be providing the user with the savedailog option.
can any1 plz guide me as to how can should i develop the code such that whatevr filename the user specifies in the savedialog box,the string data gets transferred to the file in .txt format.
thanks
|
|
|
|
|
StreamWriter class will help you
|
|
|
|
|
string content = "Whatever... :)";<br />
SaveFileDialog fileDialog = new SaveFileDialog();<br />
if (fileDialog.ShowDialog() == DialogResult.OK)<br />
{<br />
TextWriter writer = new StreamWriter(fileDialog.FileName);<br />
writer.Write(content);<br />
writer.Close();<br />
}
|
|
|
|
|
hey thanks manav....
but i have got stuck again.
saveFileDialog1.Filter = "Text File|*.txt|";
this code is giving error for me.how should i cahnge it to save it in a text format.(*.txt)
|
|
|
|
|
saveFileDialog1.Filter = "Text File|*.txt";
|
|
|
|
|
Hello Luc,
Your link to "Forum Guidelines" doesn't work any more!
All the best,
Martin
|
|
|
|
|
Thanks Martin, I think I fixed it now.
|
|
|
|
|
Hello
fileDialog.Filter="*Text File (*.txt)|*.txt";
All the best,
Martin
|
|
|
|
|
Remove | from filter...
Here is the new code
string content = "Whatever... :)";<br />
SaveFileDialog fileDialog = new SaveFileDialog();<br />
fileDialog.Filter = "Text File|*.txt";<br />
<br />
if (fileDialog.ShowDialog() == DialogResult.OK)<br />
{<br />
TextWriter writer = new StreamWriter(fileDialog.FileName);<br />
writer.Write(content);<br />
writer.Close();<br />
}
|
|
|
|
|
Hello,
I found out that my ApplicationContext instance holds a reference of my Splash window (Windows.Forms.Form), so that GC can not free the memory. (MemProfiler[^]told me)
It's not a real problem for my program, but I'm curious why.
My program is working like his:
1) At startup my splash form is instanciated.
2) An ApplicationContext instance is created, with my splash instance as parameter:
AppContext = new ApplicationContext(_splash);
Application.Run(AppContext);
3) Startup continious (instanciates classes like mainwindow and so on) and feeds splash with information to show.
4) Startup finished
5) Now my mainwindow is linked to the ApplicationContext and replaces the splash form.
AppContext.MainForm = _mainwindow;
_mainwindow.Show();
6) Splash is closed and local references which are linked to the splash class got disposed.
_splash.Close();
_splash = null;
.
.
It looks to me that in "5)" I'm doing something unsufficiant, so that AppContext still holds the ref to the splash.
I'm open for all suggestions.
Thanks for your time.
All the best,
MArtin
-- modified at 5:38 Wednesday 13th June, 2007
The ApplicationContext holds the reference to the Splash form over the Application.ThreadContext.RunMessageLoopInner method, where the instance is passed as an argument.
|
|
|
|
|
Hi Martin,
I have no experience wirth ApplicationContext; I once did a splash screen without it.
But I just read an article[^] on it, it may interest you.
Now I discovered same article here ![^]
Regards,
|
|
|
|
|
Hello Luc,
Thanks for the links.
I will go threw them and let you know if it helped.
All the best,
Martin
|
|
|
|
|
Hello Luc,
Again, thanks for your time!
I downloaded the source of the article you provided, and found out that there is exactly the same happening as in my project.
Apart from that the article shows very well how a inherited ApplicationContext class can be modified for the Splash usage.
So thanks for the link!
I also posted the question in the article, maybe the autor is interested in that fact.
All the best,
Martin
|
|
|
|
|
I have a XML file. I want to open that XML file in browser, when i click on the button.
Help me out.....
|
|
|
|
|
FileStream fileStream = new FileStream("c:\\dat.xml", FileMode.OpenOrCreate, FileAccess.Read);<br />
<br />
long len;<br />
<br />
len = fileStream.Length;<br />
<br />
Byte[] fileAsByte = new Byte[len];<br />
<br />
fileStream.Read(fileAsByte, 0, fileAsByte.Length);<br />
<br />
<br />
Response.Clear();<br />
Response.ClearContent();<br />
Response.ClearHeaders();<br />
<br />
Response.Buffer = true;<br />
Response.ContentType = "text/xml";<br />
Response.BinaryWrite(fileAsByte);<br />
Response.Flush();<br />
Response.End();
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Which button? A button on the form? If yes then add an event handler for the button and use Process class to open browser and pass the xml file as a parameter.
|
|
|
|
|
Not sure why you'd want to open the file in a specific application but the best way to open a file using the associated program is
System.Diagnostics.Process.Start("PathToYourFile");
If you really, REALLY know what you are doing and want to open it in a specific application, it will most likely support command line arguments.
System.Diagnostics.Process.Start("ApplicationPath", "PathToYourFile");
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
I need to develop one desktop application on C#. Where I have to integrate Microsoft Outlook with the application. User want to send a file or a zipped folder to an e-mail ID. User want that once he select recipient from the drop down menu of the application. All files related to that corresponding recipient, stored in a particular folder should be sent to recipient automatically, with some message. There should be folders in the local drive of the user, for each and every corresponding recipient. User wants the facility to send the files to multiple e-mail IDs (e.g. Outlook ID, Yahoo ID, Google ID) of selected recipient. List of recipient, path of corresponding folder and their corresponding multiple e-mail IDs are going to be hard-coded.
|
|
|
|
|
you should look at the system.net.mail namespace it will pretty much do what you are after. If you look up on MSDN there are a tonne of examples.
http://msdn2.microsoft.com/en-us/library/system.net.mail.aspx
That should be a good start, otherwise google is your friend.
-- modified at 5:00 Wednesday 13th June, 2007
edit: didnt realise you wanted to do it through Outlook. Then you got use the Outlook object model, the outlook interop dll, thats pretty easy. If you have access to the book Visual Studio Tools for Office, it provides some sample code.
try
http://msdn2.microsoft.com/en-us/library/ms268893(VS.80).aspx
|
|
|
|
|
how to show ballon tooltip on cell of datagrid
|
|
|
|
|
Place DataGridView on form, add some columns and rows and add event handler for CellMouseEnter. Add following code into event handler:
private void dataGridView1_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
{
if ((e.ColumnIndex >= 0) && (e.RowIndex >= 0))
dataGridView1[e.ColumnIndex, e.RowIndex].ToolTipText = e.ColumnIndex.ToString() + ":" + e.RowIndex.ToString();
}
|
|
|
|