|
Brady Kelly wrote: but it just 'looks rude' to me to be creating the LineException before any exception is caught.
I don't know what you mean by rude. Perhaps you mean it makes the code difficult to understand? If so then that is a problem you should fix if possible.
Are these exceptions being thrown by libraries you are consuming? If not and you are checking conditions and throwing the exceptions yourself then you are probably abusing exceptions.
led mike
|
|
|
|
|
I most certainly am abusing exceptions, , although it will in the near future be highly likely that some of them will be thrown by libraries.
Pits fall into Chuck Norris.
|
|
|
|
|
Throwing an empty LineException for no reason would be rude.
If the user never sees the LineException when it contains no ColumnExceptions, then it's not rude.
|
|
|
|
|
You can always throw LineExceptionByTheWayIAmSorry instead.
|
|
|
|
|
hi..i need to add an cursor to my project.I have an cursor file with me(*.cur).How to add it to my project resource and use it as my form cursor.....in normal case we are using 'this.Cursor=Cursors.None' like that...right ?
modified on Thursday, April 10, 2008 9:33 AM
|
|
|
|
|
Hi Friends,
I want to scan the file before upload on the server using c# and .net.
Can anyone help on this.
Please send me the useful link or suggestions.
Thnaks and Rgds
Nithin.
|
|
|
|
|
Of course there's nothing in the naked .NET framework for virus scanning. You'll need to either find a virus scanning API, or alternately, use an existing virus scanner and Process.Start it onto the file you want to scan.
|
|
|
|
|
Is their some sort of doo-dad that I could, e.g. implement the three default constructors on a derived exception? CodeRush?
Pits fall into Chuck Norris.
|
|
|
|
|
Would a Visual Studio code snippet work?
|
|
|
|
|
Yes in fact it would.
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Judah Himango wrote: Would a Visual Studio code snippet work?
depends on the author I guess.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
That's a situation where virtual constructors would be a good thing.
But C# doesn't have them.
|
|
|
|
|
Hi,
I am writing an application in which I have to add different worksheets to a workbook in excel. I would like the code to insert in this line: wbk.Worksheets.Add(, , , );. It is expecting a (Object Before, Object After, Object Count, Object Type). Should I use this code to add the worksheet? If not, please advise. The code I have so far is below:
Microsoft.Office.Interop.Excel.Workbook wbk = _appClass.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
...
...
wbk.Worksheets.Add(, , , );
Please Help!!
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
Hi all,
I would like to know whether it is possible to access form components from a class which is in another namespace. If not why did they decide to develop C# like that?
Many Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: I would like to know whether it is possible to access form components from a class which is in another namespace
Yes.
|
|
|
|
|
Thanks you for the reply Pete.
Is it possible that you could perhaps give me an example or a link of which you may know where I can see such an occurance?
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hmmm.
namespace MyNamespace1
{
public partial class MyForm : Form
{
MyForm()
{
....
}
public string MyValue{ get ; set; }
}
}
namespace MyNamespace2
{
public partial class MyForm2 : Form
{
private MyNamespace1.MyForm _form
public MyForm2()
{
_form = new MyNamespace1.MyForm();
_form.MyValue = "Weyhey.";
}
}
}
|
|
|
|
|
Hmmm ... So The code below will create a new instance of the first form, right? Now wouldn't that throw away any data / text that would remain on the first form?
...
private MyNamespace1.MyForm _form
public MyForm2()
{
_form = new MyNamespace1.MyForm();
_form.MyValue = "Weyhey.";
}
...
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
I just showed you how to access a form in a different namespace. How you want to handle it is up to you.
|
|
|
|
|
Hi,
every time you execute new something() you create something new.
creating a Form is not the same as showing a Form; your new Form would be invisible until
you do something to it, such as _form.Show().
creating or showing a Form does not alter any other Form.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Any time that you are accessing something from the base class library, you are accessing code that lives in another namespace. For an explicit example, create a console application and observe the default namespace assigned to your code. Now, add a call to Console.WriteLine and output some text. If you place your mouse pointer over the word Console , you'll notice that it is a class defined in the System namespace. Thus, you have just accessed a class defined in another namespace.
I get the feeling, however, that this is not the question that you meant to ask. You may wish to try rephrasing so that your intended question is a bit more clear.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
The below unhandled Exception occur at application level, when 1000 records added in datatable which is bound to DatagridView and when click on scrollbar of Datagridview (The 1000 rows was added through code using while loop)
How can I handle or resolve the same.
System.ArgumentException occured
Message="InvalidArgument=Value of '5448' is not valid for 'rowIndex'."
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.DataGridViewRow.GetStte(Int32 rowIndex)
at System.Windows.Forms.DataGridViewRowCollection.GetRowState(Int32 rowIndex)
at System.Windows.Forms.DataGridView.ComputeHeightOfFittingTrailingScrollingRows(Int32 totalVisibleFrozenHeight)
at System.Windows.Forms.DataGridView.set_VerticalOffset(Int32 value)
at System.Windows.Forms.DataGridView.DataGridViewVScrolled(Object sender, ScrollEventArgs se)
at System.Windows.Forms.ScriollBar.OnScroll(ScrollEventArgs se)
at ....................
|
|
|
|
|
Hi. I need to convert Word documents into image files using .NET, Jpeg, Gif, Bmp anything is fine. I searched through articles and message boards but couldn't find anything about this. There're word2image command line utilities but they're not free and I'd like to find any .NET and/or free solutions. Any ideas about how to do this?
Thanks.
|
|
|
|
|
There's nothing built in, your best bet is probably to control word to open the file and do a screen capture.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You could always use something like Ghostscript to print to an image printer. There is an example here[^].
|
|
|
|