Project Clean-Up - Errors Occur When Someone Doesn't Pick A Value
Oct 21, 2009
today I finished my VB project which is a program that generates costs of pizza's by what the customer order. The code is all complete just looking for some idea's on to stop bugs and clean up the code. So below is all my code and picture of the form. Errors occur when someone doesn't pick a value, so what i want is there to be default values as 0.
When I publish the program. Is there any way to get VB to publish the text files with the program so that no errors can occur. When I install and run the published program I get a series of errors relating to text files that are not found.
The user has been running the app in question for over a year with no issues like this (this is a VB2008 business/database application with an executable 4.6 MB in size). Starting last week, "all of a sudden", the user started getting INTERMITTENT error messages like the following:
Exception has been thrown by the target of an invocation. Creation of the ImageList handle did not succeed. Out of memory. Parameter is not valid.
The last two have been accompanied by the big "red cross" on the form (in the screen shots the user sent me).The fact that the one message mentions "ImageList" and poking around on the Internet for answer on "Parameter not valid" points in the direction of a graphic problem, but nothing has changed in this area for a long time, and the app only uses graphics in a very straightforward way, using images on buttons and menu items, but not doing any in-line graphics methods.
I have written a small program to aide my business and the program works fine. But while compiling the code it shows a lot of warnings like the following."late bound resolution; run time errors may occur""implicit conversion from 'Object' to 'String'." Where am i going wrong. Even though the options strict off removes the warning I want to correct the warnings.
Private Function ledgerMasterFullName(ByVal i As Integer) As String Dim fullName As String Dim vObj As Object
I am making this program for a school assignment but it has errors when calculating
Private Sub frmReceipt_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'When this form is loaded, assign the date to the date label & start the timer lblDate.Text = Date.Now
So if counter finishes, execute the following code
If counter > 4 And km >= 1 And kmcashset = 0 Then 'If there is still kms to calculate 'And kmcashset = 0 kmcashholder = kmcash km = km / 5
And if I add counter = 0 and km = 0 at the end of that "If counter > 4 And km >= 1 And kmcashset = 0" Then it doesn't calculate anything correctly. I supply it with 9 for Distance and it returns 4 for excessdistance which is correct but returns 7 for excessdistancecharge when it should be 4! When I supply 23 for Distance it returns 18 for excessdistance and 11 for excess distance charge which is correct. (???)
Excessweightcharge calculates correctly.
I think it may be the way I'm implementing it, through the use of AND or maybe it's because it's in timer tick?
-Minimum charge of $5 which covers 10 kgs for the first 5 kms only -Each kg over 10 kgs incurs a charge of $0.50 -Distances over 5 kms incur an additional charge of $1 per km up to 10 kms -For deliveries over 10 kms, the extra distance should be rounded up to the nearest 5 kms and charged at $2 for each extra 5 km block.
EXAMPLE 1: Packet weighing 9kms travelling 9 kms Standard charge for first 5 kms ($5.00) Weight less than 10 kgs so no extra weight charge Extra distance charge 9 - 5 kms = 4kms x $1 = ($4) Total delivery charge = $5 plus $4 = $9
[But my program returns 7 for excess distance charge]
EXAMPLE 2: Packet weighing 33kgs travelling 23 kms Standard charge for the first 5 kms ($5) Excess weight 33 - 10 kgs = 23kgs x $0.50 ($11.50) Extra distance (23 - 5kms = 18kms): 18kms ( 5 to 10 kms at $1/km) = ($5) 13kms (18-5)/5 = 3 (rounded up) x $2.00 = ($6) $5 + $6 = $11 Total delivery charge = $5 plus $11.50 plus $11 = $27.50
End A statement which as far as i know doesn't close you program properly and hides errors. Right now i'm being forced to use end because i don't know how else to close my program properly. I'm not sure where my problem is but some of you should be able to fix it. I'm trying to make a game using directx with a game loop. This code is the skeleton of what i'm making.
Public Class Form1 Private ProgRunning As Boolean = True
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load Me.Show() 'Make the form appear Me.Focus() 'Give the form focus
This code runs alright because end is being used but if you rem end out the error which it's hiding comes out. The error is "Object reference not set to an instance of an object." I'm not totally sure but i'm guessing that the error is refering to the form.
I am using Synclock to prevent multiple threads from logging text messages to the same file at the same time, but this doesn't seem to work:I get frequent sharing errors on the logfile, within the synclock block.The Synclock is using the variable holding the filename, because it exists all the time and because it is always the same object, whatever class instance or thread I'm in.[code]Despite using Synclock and a Using block around the code, I keep getting this error in the sw.WriteLine(Msg) line:System.IO.IOException: The process cannot access the file '(filename)' because it is being used by another process.Should I use some other type of object than a string to synchronize on?I cannot use a user interface object (button or so) because it is a windows service project.It was written and compiled in Visual Studio 2008, but targeting the 2.0 framework because it has to be able to run on some old Win2000 machines.
A need came up for me to work on a program that resides on a web server. I can't pull up the code and I get these errors:
In addition, you must run Visual Studio in the context of an administrator account. I have never worked on anything like this before and for right now I would just like to look at the code. I Googled and found this: You can enable these features in the Add/Remove Programs control panel. In there you wiull find a link off on the left labeled something like 'Turn Windows features on or off'. Click that and you'll get a UI for managing the IIS features that are installed.
I looked there and don't have a clue what I should check. I'm on Windows 7. What should my approach be? I don't want to just clicking things in the IIS configuration console. The attachment is what I see.
I have a project that as a standalone runs perfectly. There are a number of routines, forms etc. that I want to incorporate into another solution that I have created. Each time I try, it will load in the new project, but if I try to access anything by clicking on it, one of two things happens, either VS crashes and then restarts OR I get 100+ designer errors thrown.
I have attached my project. I have made a web browser I don't get any errors but it doesn't run/debug.I don't know why but i checked everything. If somebody could tell me what's wrong with my project it would be awesomeBill Wiz, on 17 June 2012 - 12:30 PM, said:I have made a web browser I don't get any errors but it doesn't run/debug.[url]...
I have been trying to build the "Testing a class lesson, but the Set as StartUp Project line in the Project menu does not exist! I have redone the entire project 7 times, always the same response! # different computers, all with registered versions of VB. Why does this problem persist?
I am using Visual studio 2008. I didn't see a place to post questions about this . I am creating a mobile application, at run time the executable itself is not updating to show the changes from source code i have written. I feel there must be a setting or something in visual studio .
I developed a project is vb.net express 2008. Published it and the whole clickonce didn't work. Now I have Visual Studio 2008. I opened my project and have been working on it for weeks now. when I build it today it said biuld successful but the new .exe file etc have not been written to my Release folder.
I am having trouble with this code. Can someone tell me why the "Project Processing' section doesn't run at all? The 'Client Processing' section runs and executes find but it seems the 'Project Processing' section does not.
Public Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click Dim mBaseFolder As String Dim mProjectFolder As String Dim mClientName As String Dim sClientFolder As String Dim sProjectFolder As String
Below is my code to give you an idea, not exactly what I have in my application but pretty close.
I have just received an interesting feedback from a VB.NET customer using our product - for some reason intellisense hidden a certain enumeration value.After a small testing I have found that this is likely a bug in IntelliSense: [URL]..To be honest, I did not expect this problem with such a basic stuff like this. Have you seen this in the past? For me, it doesn't work in all VS versions...
Anyway, feel free to track this issue if you are coding in VB.NET.
It is saved on my desktop for easy access.I can close the program. I can click the solution to open it right back up, no problems.I then zip my file (also to the desktop)
My problem: I moved the original file (Project A) to another folder and extracted the unzipped Project A onto the desktop. When I open the new Project A's solution file, nothing happens besides VB starting up. It doesn't show me anything.
In my application, i have put a question on form closing if the user wants to save the changes?. But right now, i have just put it in default whether they make changes or not.I thought of prompting it on text change.. but the text automatically changes on load as it retrieves data from sql server.
What is the code that I can use to describe what happens when there is not just one exception in a'Try...Catch..Finally...End Try' statement? For example: 'Catch' is used to describe what happens when a certain exception occurs, but what can I use to describe what happens when a certain exception does NOT occur?
me and a partner need to play sounds when certain events occur, however, every method we try..
My.Computer.Audo.Play("file.wav") or? Sound.PlayWaveFile("file.wav") from this class: http:[url]....etc they all don't work
They do NOT throw any exceptions, they just dont play the music, the test demo of the Sound Class works like a charm, its just not working in our project..same with My.Computer. Audio. Play.what could we have done to make it so that we can't play sounds from our application?
PS: this problem occurs on all of the computers we test it on, yet the normal sound-playing methods seem to work on all of those computers when they are implemented in other projects.. its just not working in these instances
Private Sub done_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles done.Click Dim s As Integer = ComboBox1.SelectedIndex Dim t As Integer = ComboBox2.SelectedIndex Dim x As Integer
Here is my drop down list and data source. My question is.. when is it possible to set a defaulted selected option for the drop down list, aka when have all the dropdownlists been databound and their ListItems populated? I have tried Page_PreRender, age_PreRenderComplete, Page_Load.I have read over MSDN's Page Life cycle event which suggest Page_PreRender.
I am trying to create a background worker that will spawn a dialog, while a long event is occurring. For example, when the main thread in trying to connect connect to a db and update a large amount of records, I would like to have the background worker spawn a dialog that advises the user to "Please Wait"
Here is what I have so far 1. I create a background worker using the drag and drop 2. Before the event that taking a long time starts I call: Me.BackgroundWorker1.RunWorkerAsync() BackgroundWorker1.WorkerReportsProgress = True 3. This is the events for the bgworker, all of which was enabled in the form designer:
Private Delegate Sub delCreateNewForm() Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork Dim d As New delCreateNewForm(AddressOf CreateNewForm) Me.Invoke(d) [Code] .....
4. When the long activity is completed I call this: BackgroundWorker1.ReportProgress(0) Everything seems to work fine, except that the newly spawned dialog in no responsive and appears to be frozen, until its closed by the Progress Changed event.
how do I refer to a panel. i,e. i have 5 panels in total, and based on specific inputs , i want changes to occur in specific panels(each stored in a tab). So, now how do i give the control to the rspective panel ??
I have a DataGridView control in my windows form application. What i want to do is this: I want to reload the view so that it shows the correct data when a change occur to the database table that it is bound. In other words, when i delete a record, using an sql query not the DataGridView1.Rows.Remove(DataGridView1.CurrentRow) property, i want the changes to occur to the datagridview also. For example: I have a customers table that is bound to the datagridview. When i delete a record, lets say the one with ID=5, i want the row to be removed from the gridview in run-time. Is this possible?
i want to know what are the methods in order for me to extract the information that is stored in the exception. i also would like to know how do i extract the code line that caused the exception to occur.