Program Locking When Performing Some Tasks
Feb 3, 2011
I have a program that has the option to create a restore point. My problem is that when you click on it to do so, the program just locks up until it's finished creating the restore point. I have put a separate form on the program and it has a Marquee Progress Bar Control which I downloaded, so the idea is.
User clicks "Create Restore Point"
frmRestore.show
Marquee Progress Bar goes on and on while the restore point is created
Restore point is done
frmRestore.hide
The thing is, when you click create restore point, the form shows and the program just locks up, onces the restore point is created the form hides again. Could this problem be solved with a Background worker? To be honest I'm not completely sure what it does, I mucked around with the controls but can't seem to find anything useful.
View 3 Replies
ADVERTISEMENT
Nov 23, 2011
I have a program that has the option to create a restore point...My problem is that when you click on it to do so, the program just locks up until it's finished creating the restore point.
View 13 Replies
Mar 19, 2010
Ineed a VBS script that removes all scheduled tasks which start with a specific string.
For example, delete all scheduled tasks which start with "My Application Tasks..."
I wanna use this VBS script in my application uninstaller so all tasks created by my application are removed at the uninstall time, however am not familiar with VBS.
View 1 Replies
Jul 27, 2009
how to make a simple folder locking program and sorry don't have any code for it.
View 2 Replies
Jan 19, 2012
I'm interested in making a licence key system to incorporate into my programs. I understand the general idea of checking a database for used keys, but I don't know how I can implement a system into my programs.
I had an idea of creating a custom algorithm, creating a file which contains the licence key, which is encoded with the new algorithm. So people can't just guess the licence because they can't understand what the algorithm (like a custom hash) means. On the contrary, would it be possible to somehow set a licence key variable in my program when it is built or installed somehow? Because I don't understand how it would be possible to work out what key the user needs etc...
After writing that last sentence, I realised that when somebody pays for some software or registers, their username and email is put into a database, and then when they want to register the software, they have to fill in their username, email, and then licence key. Then the key will be filled in in the database. Would that work?
View 8 Replies
Jul 7, 2009
I'm using Visual Studio 2008 and developing a VB.NET application. I'm having strange lockup problems with my program, but only when Internet explorer 8 is opened.
When I cover my form with another window and then uncover it, I find that it has locked up. My program has no references to IE and the only thing it even has to do with IE is using Process.Start with a web address.
My program works fine and exactly as it should, but only when IE is not opened.
Does anyone know why a program would lock up only while IE is running?
Edit: I've done some digging and I've found the offending thread in my program.
I don't know what starts this thread or what it does, but when I kill it, my program no longer freezes. The thread is one of the CreateApplicationContext threads, here is the last few items in the stack trace of that thread.
6 ntkrnlpa.exe+0x897bc
7 ntdll.dll!KiFastSystemCallRet
8 mscorwrks.dll!LogHelp_TerminateOnAssert+0x61
9 mscorwrks.dll!DllUnregisterServerInternal+0x10523
10 mscorwrks.dll!DllUnregisterServerInternal+0x10542
11 mscorwrks.dll!StrongNameErrorInfo+0x34387
12 mscorwrks.dll!StrongNameErrorInfo+0x34815
13 mscorwrks.dll!CreateApplicationContext+0xbc35
14 KERNEL32.dll!GetModuleHandleA+0xdf
Process explorer says my program is using no CPU nor throwing any exceptions while it is hung.
View 1 Replies
Nov 15, 2011
Our program works fine, until someone locks the computer or the screen-saver pops up (but not ctrl+alt+delete). Once the computer is unlocked/the screen saver is closed, the application stops drawing everything except the title bar, and stops responding to input - it displays a mostly-white window which can't be moved or closed.(Example of application freezing - the mountains are from my desktop background)If we let it sit for about 5~10 minutes, it comes back to life, and doesn't hang again (even after locking the computer/screen saver popup) until the application is restarted.
View 9 Replies
Nov 26, 2011
I have a program that uses a tabcontrol. Each tab represents a collection of common tasks and, as one would expect, has a bunch of controls on it.
In my original version of this app, I simply put all functions/subs/etc related to a specific tab right in the main form class; I just divided them with lines and a few extra blank CRLF so I could jump from section to section within the code (literally named Tab1 Code, Tab2 Code, and so forth).
I am re-working the program and thought I'd use modules for this instead. So, I built all the forms and grabbed the code from the previous version, created a new module, then pasted the code into the module. VB.Net 2010 has choked all over this with a zillion errors. The functions/subs are all public, but they cannot see any of the controls on the main form. Every control that is in existence on the main form comes up as being not declared in the module.
This is the first time I've tried to use a module without a full class, and the first time I've tried referencing back to controls on the main form in this fashion (I've always just used it for functions/subs that I pass data to). Am I trying to do something here that shouldn't be done or...? I basically just want to create files so I can segregate the code into a more logical design.
View 4 Replies
May 20, 2009
I've trying to do an inner join select statement where I select two fields from a table, and than all the records of a field in a second table that have the same id as the first table.The code looks as follow:
Dim conn As OleDbConnection
Dim cmd As OleDbCommand
Public Sub openDB()
[code]....
I get a an exception: "invalid bracketing of name [Vegetables Descriptions.DescID] if I take it out to make it look as follow I get a "Join expression not supported"
da = New OleDbDataAdapter("SELECT [Vegetables Descriptions.Task], [Vegetables Descriptions.Description], [TasksOcc.When] FROM [Vegetables Descriptions] INNER JOIN [TasksOcc] ON [DescID] = [DescID] WHERE [Vegetables Descriptions.VegeID] = vegeID", conn)
I tried folowing examples from the net but where unsuccessful.
View 3 Replies
Nov 11, 2010
I would like to perform an audit as part of a unit test that uses reflection to verify some assumptions, the basic-psuedo code for this would be as follows:
[Code]...
View 2 Replies
Jun 30, 2011
I know about VSTO/VSTA, and I also know that some VBA functionality (with .NET syntax of course) can be done in .NET. There is definitely a learning curve going from VBA to .NET without VSTO. My question though is, can everything that is done in VBA somehow be recreated in .NET without VSTO?
The reason is because I am converting my VBA application into .NET for several reasons: I want to take advantage of OO, my class libraries will be better available for use, and for fun. I wouldn't be too happy if I got so far in only to learn of some limitations.
View 1 Replies
Jun 21, 2009
If I have code like this (C# or VB.Net does not matter)
Dim e As IEnumerable(Of XElement) = _
From s In _dataSourceSettings.Elements _
Where s.Attribute("name").Value = toInsert.Attribute("name").Value
If e.Count > 0 Then
e.Remove()
End If
How do I get now new _dataSourceSettings without element that I removed?
View 1 Replies
Feb 4, 2011
I am writing a INSERT Statement which will INSERT data into a Access 97 DB.Everytime i run the Statement from my VB.NET Code i always get Error in INSERT SyntaxI have narrowed it down to one DB Field - INSERT INTO TEMP (Size) VALUES ('" & varSize & "') - I have taken all the other variable out.
Is the fieldname "Size" a reserved name or anything in Access 97 and is there a way round this so my whole statement will work including the Size part?
I have some old VB6 code which was written by someone else who is doing the same insert but instead of INSERT they have created a VB6 RecSet and set all the values then used RecSet.Update to insert the row of data. Is there a VB.NET version of RecSet and Update.
View 2 Replies
Jul 26, 2010
I am writing a program that rolls those crazy many-sided dice for use in fantasy games, and I have come to a point in my work where I am completely stumped. I am hoping that some of the more seasoned VB programmers on these forums might be able to point me in the right direction.
If this explanation gets a bit lengthy, please forgive me; I tend to be long winded. The feature I am trying to implement is that every roll result can have one or more "damage types" associated with it, such as "Fire" or "Acid". If I rolled a dice with "Fire" as the type, and the resulting dice roll was a 4, this would result in an output string of "4[Fire]". If there are more than one type, they are separated by commas like "4[Fire,Acid]".
The problem is when performing math while keeping track of these types. For addition and subtraction, there is little problem, "4[Fire]" added to "4[Acid]" is simple "8(4[Fire], 4[Acid])", while "8[Cold]" minus "4[Fire]" will leave "4[Cold]". Still with me? The problem comes into play when we multiply or divide rolls with types together. If we multiply "4[Fire]" and "4[Acid]", we get "16[Fire,Acid]" which is different than either "Fire" or "Acid" alone. Similarly, if we divide that "16[Fire,Acid]" by "4[Fire]", we are left with "4[Acid]", but if we divide by "4[Cold]" instead we will have "4[Fire,Acid]"
So how do I go about keeping track of this? Some of the dice strings my parser can handle might have dozens of damage types that might need to be figured into the total results. The result should display the total for the entire calculation, with results per damage type tracked separately. Currently I am using code that parses the string data above so that every type name is stored in an array with a integer variable associated with it for the total of that damage type. So, for the string "4[Fire,Ice]" I am storing the info in a variable that holds the 4 and an array that holds "Fire" and "Ice".
View 17 Replies
Oct 16, 2009
i'm trying to set a discount to a product between two dates / times.Is it possible to achieve it?Are there any examples
View 3 Replies
Jan 28, 2011
I would like to know about timer_tick function.I have one form(form1) with 2 buttons : button1 and save respectively. There are picturebox and a timer as well Upon form1 show, I would like to use ALT + printscreen to perform button1 click. Having said that, when button1 click, it will perform Clipboard.ContainsImage() which is in timer_click. How to ensure that I can use ALT + Printscreen and able to capture the image?
Initially this function will be activated when user press printscreen button and it will show the image captured. However I have amended to add a button to perform the same action (ALT + Printscreen) ---> perform button click..and capture screen:
[Code]...
View 5 Replies
Aug 20, 2009
I am trying to multiply timespan by an integer....
Private Sub wtothrs0_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles wtothrs0.MouseClick
Dim temp As TimeSpan = TimeSpan.Parse(ttothrs0.Text) + TimeSpan.Parse(wetothrs0.Text)
wtothrs0.Text = temp.ToString
[code]....
i gives the error mes "Input string was not in a correct format."
View 14 Replies
Mar 28, 2011
Can I perform an action when the X (CLOSE BUTTON) will be press?ex.If he pressed the X button then a msgbox will prompt and will verify his action of closing the application.
View 1 Replies
Mar 11, 2012
I have created tool which performs batch processing on files that are selected. The sub routine I have defined in the code, now I want to implement a way through which I can select actions that I want to perform and then perform the actions. For example the list has multiple actions, like Open, Close, SaveAs, Resize, Color Correct etc. I should be able to select what all I want to do on each file and then perform this actions. Someone suggested me using delegates for this, but I cant use that since all my functions have different parameters. Ither option I had is to use a nested IfElse or Switch to determine which action is selected and call function according to it, but thats to heavy I think, is there any optimized a better way to do this.???
View 2 Replies
Jul 12, 2011
I am pretty new to using LINQ and have been trying it out querying my strongly typed DataTable.
I have managed to perform a 'Select' ok but was wondering if someone can point me in the right direction to do Insert and Updates. I'm not sure if LINQ is best doing an insert at all?
My Select code is as follows:
Dim results = From myRow In _dt.AsEnumerable() _
Where myRow.Language_key = Lang And _
myRow.Section_key = SectionKey And _
[Code]....
View 1 Replies
Apr 25, 2012
I haven't used VB in 2 years and have forgetten way too much, but I still understand quite a bit. I just can't synthesize it.
Anyways, here is what I am struggling to do.
I have a CSV file as formatted in the screenshot at this link:[URL]
Number of rows can change but the number of columns won't.
I need to:
1:read in a csv file
2:take the second column save the first and last number as a variables for computations (these numbers will be the smallest and largest numbers, respectively if that makes it easier to program)
3:put into the first column of a new array the following computations based on the 2nd column from the csv file computation=((array value-first number)/(last number-first number)*100)
4:add to first column the same computations again but +100 i.e. if the first row had a cell that had computed to 1 then the next number would be 101
5:add to first column again the same computations again but with an addition +100 (+200 total) this should cause the column to have numbers between 0 and 300
6:write column 3 of array to 2nd column of the new array
7:write column 4 of array to the end of 2nd column of the new array
8:write column 5 of array to the end of 2nd column of the new array
9:delete excess array space
10:write new array to txt file with delimiter of " " (a tab) with the same name as the previous file
I have been looking at this for 6 hours now and although I figured out how to read in a csv file, I was not able to figure out how to call up the individual values for computations.
I won't complain if you give me code but what I really want is an understanding of what I need to do to accomplish this.
View 1 Replies
May 24, 2010
I hope this is the right forum. I've been developing something for a while now, and I've hit some walls with the direction I was going. I'm not an expert in .Net, so I was hoping maybe there's a nice solution that I had no idea of its existance.
A little bit of background: I'm building a relatively large scale calculation component which used to be in a spreadsheet. It composes of about 1300 values, about 150 which are passed in to the component, and the remaining 1150 are calculated based on these inputs. However, these values can be in multiple rows, as in there will be multiple rows of these 1300 values. Aggregate calculations need to be performed on these rows on a regular basis. Right now I'm using a dataset to perform this since it supports multi-row calculations nicely, but it has its limitations. It doesn't support some of the mathematical functions that I need it to perform (such as exponential) and performing a calculation like a weighted average is a hassle because you need to add a new field for it. Furthermore it doesn't let you use custom variables in your expressions, so if you want to create an on/off switch for something you need to create a single row table and set up a relationship to it. Also I'm getting tired of the dataset designer being riddled with bugs, and it's obvious to me that it was not meant for calculations of this magnitude. Not being able to see the data type of the field in the designer is a minus too (you have to bring up the property window on that field). I looked in to just creating classes to perform this, but the problem is that it needs to be relatively dynamic, and the calculations need to refresh based on user inputs. The best way I can think of doing this is setting up the 1150 calculated variables as properties so that they will be calculated automatically. But, I'm afraid that this is going to fire off thousands of calculations each time any variable is accessed, which is going to be a rather significant performance hit.
So, my question is whether anyone knows of a good structure or component that I could use to achieve my goals. I apologize if I didn't do a very good job explaining my situation, so I'll try to elaborate on any of my explanations if anything is unclear.
View 5 Replies
Apr 11, 2009
im using an open source backup tool and im going to add extra functions. [Code] All in all im wondering how i can incorporate "sleep" into sleeping until the selected time, and then performing the backup.
View 1 Replies
Sep 23, 2010
I am in the process of writing an application that requires a single transaction updating several tables. The front end has a header record and several detail records. I do not maintain any type of lock on the original read. The read is performed by calling a stored procedure in an existing database to pass back the data.
When I update the data each detail record is updated individually. Is there away I can update all of the records within a single transaction? The update will be performed via a stored procedure that is stored on the server. I cannot store the code in the application as other applications will need to use the same server side code. I can handle updating a single record my issue come about when I've updated 5 records and the 6th fails, how do I rollback the 1st 5 records.
View 2 Replies
Mar 27, 2012
I have an asynchronous task that is executing a function. The function does not contains any looping statements, but instead it is executing series of sql commands on sql server. Now, i have a button on my window that can cancel these sql operations. In other words, cancel the whole asynchronous task.
I know that this technique will require CancellationTokenSource and CancellationToken to cancel the task, but i've seen many examples on the internet and all of them are showing that the function that task is executing contains loop statements in which they are checking for IsCancellationRequested boolean property. But in my case, it is not so. My function does not have any loop statements in which i can do a check on this boolean property.
View 3 Replies
Sep 20, 2009
I have made an countdown app that is working in a normal way (added picture of it). Now when I select a number in the numeric box and click start, it starts to count down from that many minutes, but what I want is the number I put in the box *3. So if I put in 3 (points) the counter will count down 9 minutes. If it is possible I want a counter at the bottom every 3 minutes the value of the 000 at the bottom of the image multiply by 1 (+1 for every 3 mins timer1 runs).
View 8 Replies
Jun 17, 2011
Is it possible to define my list of strings like in 'good old' VB60, to use only on ebyte of memory for each character? .NET always seems to store any string as unicode, which doubles the required memory. The case is that I have a huge list of strings, all of the same size. It is about 50.000.000 items, 12 characters each. You can imagine I am running out of memory in no time. I tried converting them to arrays-of-bytes but in that case I loose the possibility to perform a "LIKE" statement in a FOR-EACH loop to check for a specific item.
View 6 Replies
Dec 17, 2011
.Net 4.0
Option Strict On
Option Explicit On
This works perfectly:
Dim N As BigInteger
N = 28 'Put whatever value you want in for N.
Write((BigInteger.Log(N) / BigInteger.Log(2) + 1) / 2)
This does not work:
Dim Result As BigInteger = (BigInteger.Log(N) / BigInteger.Log(2) + 1) / 2
This gives an error during the build (despite the variable being declared as a BigInteger and the operation working perfectly well when I am not assigning it to a variable, it tells me I can't convert a Double to a BigInteger) and I have to do this:
Dim Result As BigInteger = CType((((BigInteger.Log(N) / BigInteger.Log(2)) + 1) / 2), BigInteger)
This if course gives a different, that is, incorrect result.'This doesn't work either.
Dim Result As BigInteger = BigInteger.Log(N)
'I can do this:
Dim ResultString As String = BigInteger.Log(N).ToString
'But then parsing the string fails
[code]....
View 11 Replies
Jan 14, 2011
I'm a Python programmer and VB.NET newbie converting an application from Python to VB.NET (3.5).In Python, I have a function which returns a list of tuples which I run on two datasets with results like this:
data1 = [(1,"a",2),(5,"c",7)...]
data2 = [(1,"a",2),(5,"x",7)...]
Then I want to check if the two data sets are identical.In Python I check for equality like this:
"Equal" if data1 == data2 else "Not Equal"I want to know the easiest way to structure the data in VB.NET.
It looks like the right data structure for each data set in VB.NET is a List(of Something).
Should I create a Class to hold each data item, or is there a simpler way? If I do, will I need a custom way to decide if two instances hold the same data? What is the easiest way to compare the two data sets for equality?
View 2 Replies
Mar 27, 2009
I am using the windows installer which comes with VS 2008 to deploy my software. My initial deployment went well and I have several happy customers now. Unfortunately, one of my users found a bug. I have been able to locate and repair the issue- a simple math error in one of my forms. Now I need to deploy the repair to my existing customers without causing them too much headache in the update or, worse yet, inadvertantly deleting their stored database files.I know I can have them back up their existing db file, reinstall thenew app, and replace the new db files with their backup versions- but what a pain in the neck that will be, and it really won't look too professional, either.Does anyone know how to produce a patch to replace only the form that was repaired? Or, can I somehow exclude installing the new database files in the patch? I know the solution revolves around the Upgrade Code and Product Code, but I'm not putting the information together in my head very well.
View 6 Replies