|
Have you resolved this?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
No... Haven't found any solution that is even close.
Windows is just as secure as Linux. When shielded with a Firewall, Anti-Virus, Anti-Spyware and disconnected from the Internet.
Windows has even better performance that Linux. When running without Firewall, Anti-Virus and Anti-Spywayre.
|
|
|
|
|
Yes it looks much better with PRE tags; why did you use CODE tags in the other forum?
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I have created a simple .NET applicaton which accepts an input parameter.Then I registered the same DLL to the webserver.
Tried to use it on ASP Script and worked fine till the creation of object. But as soon as I pass a parameter to the method of the DLL It thows invalid argument type.
Then i Thought there might me some datatype issue. I then simply returned a string "hello". On output of the ASP page I always see "1" and not the string.
Any suggestions.
Pavas
|
|
|
|
|
Have you resolved this?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
No not yet but have moved to another approach.
Thanks for the reply on this.
Regards,
Pavas
|
|
|
|
|
Using VB.net is it possible to disable the menu of excel?;)
for example:
From the menu there is File, Edit, View, Tools
I wanted to disable the Tools menu.
How can I do it on vb.net.
|
|
|
|
|
It might be possible through Office Interop functions/classes.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
Dont have any idea how to do it.
Do you know how?
|
|
|
|
|
Hi,
The function mentioned in code returns the comments of a latest version of a source safe file item, when i call this function twice for two different source safe files, i get the error "A history operation is already in progress", and due to that unable to get the comments of second file, Any Idea how to resolve that.
public string GetCommentsOfLatestVSSItem(string strVSSItemPath)<br />
{<br />
IVSSItem objVSSItem;<br />
objVSSItem = m_SSDB.get_VSSItem(strVSSItemPath, false);<br />
string strComment = ""; <br />
foreach (IVSSVersion vssVersion in objVSSItem.get_Versions(0))<br />
{<br />
strComment = vssVersion.Comment;<br />
return strComment;<br />
}<br />
catch (System.Runtime.InteropServices.COMException ex)<br />
{<br />
return ex.Message + " -> " + ex.StackTrace;<br />
}<br />
catch (System.Net.WebException we)<br />
{<br />
return we.Message + " -> " + we.StackTrace;<br />
}<br />
catch (System.Exception ex)<br />
{<br />
return ex.Message + " -> " + ex.StackTrace;<br />
}<br />
<br />
}
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
Hi,
I don't know about yout problem ("A history operation is already in progress"). But I have
two comments:
1.
your three catch blocks do the same thing, you can omit the first two with no change.
2.
It is a bad idea to ignore part of an Exception; an Exception holds more, sometimes much
more, information than you are using (Message+StackTrace). The only right thing to do
is use ToString(). It will show extra info such as the file name on file I/O problems,
and everything about nested exceptions.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I work for a state agency that has a multiple page, multiple question application form. Because the application centers around eligibility for a payoff, there are different paths that an applicant may take through the application. For instance, depending upon their answers, they may only need to fill out one or two pages of questions, but could conceivably need to fill out more pages depending upon whether or not further information is required.
What sort of approach/technology would be ideal to handing this sort of thing in .NET? Currently, it is handled in a very clumsy manner involving multiple .aspx pages and a lot of unnecessary, hard-coded session variables and logic checks. In this environment it's easy for things to become unnecessarily complicated, and changes to a single question might require changes in multiple places throughout the application (especially to database calls).
One method I was thinking of would be a single .aspx page with a multiview control backed by XML files for each page of questions where the questions are given attributes that define what type of question they are (i.e. yes/no, checkbox, text), as well as the name they are to be given in the database (i.e. "absence_eligibility1").
Something like this, perhaps:
<page id="eligibility1">
<question type="checkbox" triggersno="eligibility1">
Were you here for 90 days, etc etc?
</question>
<question type="yesnoradio" triggersyes="eligibility3">
Were you here for 180 days, etc etc?
</question>
</page>
Is this a good way to do it? Is there a better way?
|
|
|
|
|
Normally, this type of system uses something like SQL Server. You could design your tables something like this:
QuestionTable
QuestionID int
QuestionText NVARCHAR(MAX)
DependencyTable
ParentQuestionID int
AnswerType int
DependentQuestionID int
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello All,
In my vb.net application i am playing audio files using window media player.
Sometimes application fails , if window media player is not installed on the user's machine.
So, how it can be detect whether media plyer is available or not befor plying.
Does any API exists using which we can retrieve data from system registry.
Anyone who knows the answer, Please tell
Any help will be highly appreciated.
Thanks in advance.
|
|
|
|
|
If you want to detect whether media player is installed, you need to check whether or not the wmplayer.exe file exists in "[BOOTDRIVE]:\Program Files\Windows Media Player\wmplayer.exe". To do that, you need to check it when your main form loads. Example below:
Imports System.IO
Dim ProgramsPath As String = My.Computer.FileSystem.SpecialDirectories.ProgramFiles
If File.Exists(ProgramsPath & "\Windows Media Player\wmplayer.exe") = False Then
// Exit the application. or, whatever you want to do.
Application.Exit()
End If
That should do it. Good luck with your program!
|
|
|
|
|
Hi guys,
I am building some components for my windows app, one of which contains a SplitContainer. Once i put the control into the host form, i can't do anything with the controls in my custom control. I'd like to enable some re-arranging functionality inside this, i.e. the ability to drag the split bar.
Could anyone give me points in the right direction? I'm not entirely sure what i'm looking for.
Cheers
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
|
Hi Everyone,
I have a few doubts regarding Exception Throwing. I read from documentation that while designing methods in a Framework, exceptions are the primary means of reporting errors in frameworks. However is Exception Throwing always the better way to communicate errors? Consider a scenario, where we have to validate the Input parameters of a method , when the input validation fails , which mode of approach is more suited – throwing an ArgumentException or returning an error code.
|
|
|
|
|
If you return an error code, you are putting the emphasis on somebody actually reading the error code and doing something with it. At some point, somebody has to say "this is wrong, I need to do something". This is obviously an exceptional case, hence you should really consider designing with an exception.
However, it is perfectly valid to have some logic in your code where you may attempt to do something if the condition fails. For instance, if you are saving an item to a database for a user, it is better to write to an alternative database if you can't get to the master and then synchronize the two later on, than to just fail and tell the user that it's tough but you can't save their work.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Pete ,
I agree to your point... But microsoft itself is coming up with method that contradicts exception throwing as way of reporting errors.... For ex:- new methods like bool.TryParse , Dictionary.TryGetValue Method etc which does not throw exception , they return boolean value indicating the status of conversion instead of throwing exceptions...
|
|
|
|
|
That's OK for low-level operations, where it is sufficient just to know whether an operation was successful or not without the overhead of raising an exception if it wasn't. However for higher-level business logic operations e.g. saving some data to a database, more detailed error information would be required by the code consumer if something went wrong. Raising exceptions is a good way of providing this information.
Paul
|
|
|
|
|
Yes they introduced the TryXYZ methods but this is not a contradiction because there are a lot of scenarios where you have a string with user input and have to know if it is an int. And if it is not this is not a real exception. Using exceptions for user input checking is not the right way to go. Exception should only be used in real exception cases.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
The Tryxxx pattern doesn't contradict exception handling at all. This pattern is designed for very fast testing in cases where you can take an alternative path if the value isn't valid.
For a more detailed explanation of the TryParse pattern, take a look at this blog entry:
http://blogs.msdn.com/kcwalina/archive/2005/03/16/396787.aspx[^]
Taken from the comments on this entry:
Parse says it’s going to parse something. “Failure” means it couldn’t parse it. So exceptions from Parse could include exceptions because what you passed to it wasn’t parseable. The return value is the result of the operation—the parsed value.
TryParse says it’s going to try to parse something. “Failure” means that it wasn’t even able to try to parse the thing. Thus the only kinds of exceptions you’re going to get out of TryParse are things like OutOfMemory from JITting or allocating buffers before it even gets a chance to look at the string to be parsed. (You wouldn’t expect to get an exception because the value wasn’t parseable…the point is the method said it was going to try, and it did try. It did what it said it would, so no exception needed.) TryParse really has two results—was the thing parseable, and if so the parsed value.
|
|
|
|
|
Hi,
exceptions are fine in that they allow you to perform a sequence of operations and get
informed automatically if something went wrong in the middle. The main idea is normally
things run fine and an Exception is the exceptional case.
on the other hand you may have a lot of methods whose main purpose is to check something
that may or may not be true. Examples are IsNumeric, TryParse, IsNull, ...
Here the caller expects a pass/fail result, and the probabilities may not be very different;
so the caller does not want the overhead of exceptions, he wants a bool (or possibly
an int or enum as a result code, as in ShowDialog).
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
So the typical Design can be ErrorCodes as error indicators for functions that do Checking and validations, where are processing related functions can have exceptions as error indicators
|
|
|
|