.net - Locking - Extent And Modes Of Failure

Jan 9, 2012

I've stress tested the code below and it seems to work fine - what are the dangers of not locking in the simple case where there is a single thread writing and a separate thread reading a simple variable? Have a class that has a public property...

[Code]...

View 3 Replies


ADVERTISEMENT

Set A Combo Box To Extent To Right

Mar 24, 2011

On my program I am trying to set a combo box to extent to the right when there's room I looked in the properties and i didn't see anything that would be helpful. I put in a flow layout panel and nothing.

View 7 Replies

How To Get Time To Extent Of Exact Millisecond

Mar 11, 2011

I am developing an application that is very very time critical. I want to put a log writer in the code so that i can track the events and find out where the application is wasting the time.But the problem is that vb.net tells the time only at a interval of 15.25 milliseconds what to do. although msdn documentation says that we can get the time in millisecond.
To understand my problem better pls go through the following code. this code is written on a click event of a button and it writes down the time in a log file. The problem is that it writes time like 16,16,16 and after some time when the dx value reaches to say 5000 it jumps to 31 and then to 46 and so on.

dx = 1
While dx <= 100000
dx = dx + 1
SRLog1.WriteLine("dx vALUE > " & CStr(dx) & " Ticks -> " + CStr(Now.Millisecond))
End While

View 2 Replies

Change The Click Event For Different Modes?

Oct 9, 2010

I hhave two modes in my application. Either of the mode is on at any part of time during the running of the application. I have given the user the option to create PicutreBoxes at runtime. Further, I have give two different options to the user.

If the first mode is selected, the Click event for the PictureBox is is pb_clikc and if the second mode is selected, the click event is pb_click_sp.

But the problem is that on the mode select event, I can't specify this line of code since picb is not existing in the current context.

picb.Click += picb_click for Mode1

or

picb.Click += picb_click for Mode2

View 3 Replies

Game Programming :: Display Modes In .Net?

May 1, 2008

Is there any way to set coop levels in the .Drawing namespace (or any other namespace, for that matter)?I have made some games in Direct X that were easily shown as full screen apps, but I have returned to the basics of the Graphics class and can find no way to do this. I want to make a full-screen game only using GDI+.Resizing the form and taking away the taskbar is not really what I'm looking for. I just need to know if I can change the moniter resolution as easily as any of the Direct X reference libraries. And a push in the right direction.

View 5 Replies

VS 2008 File Open Modes?

Mar 8, 2010

Can someone point me in the right direction? I am trying to find out the 5 modes a file can be opened in.

I can only think of Input, Read and Shared. What are the other two?

View 8 Replies

ADO.NET And SQL Locking?

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

.net - Locking A Control From Another Thread In VB

Mar 18, 2011

I am developing a parser application to build a call tree from DDL files that have been extracted from a database. The idea is to take a large number of these DDL files and determine exactly what calls what. To do this I am using a .NET TreeView. The final output I am working toward is something like this:

-Proc1
-Proc2
-Proc3

[Code].....

View 2 Replies

.net 2.0 Threading File Locking

Oct 3, 2010

I'm using vb.net 2005, I've got the following code running a thread to download a file. However, the process fails sometimes when trying to read the local copy of the file. I think I may need to unlock the local file somehow but I'm not sure how to do this.[code]

View 1 Replies

C# - Application Suddenly Locking Up

Jan 10, 2012

i have this application, that creates various custom AppDomains, each app domain executes a assembly and its dependencies, like a plugin, a separated assembly, that manipulates database, own resources, etc.

the application runs fine for a while, but suddenly, it locks up... the process does NOT die, it just freezes, i ran a remote debugger on top of it, on the thread window i can see EVERY thread, they are with the status "running" (not "thaw") but, in the same place, not executing. i can pause and run the debug, and it remains in the same place. there are NO locks, synlocks, monitors, on the code and the code for loading the appdomains is very simple, no big deal on it. like i said, its working, but after a while, it locks up. Any ideas on this environment?

View 1 Replies

Locking - Block .exe To Launch?

Feb 17, 2012

does someone have an example code for how to prevent .exe files to be started?

Something like this might work:

For Each OSKInstance As Process In Process.GetProcessesByName("OSK").ToArray
OSKInstance.Kill()
Next

But that might be resource intense as a while loop is running all the time. Is there a smarter way to lock an .exe?

View 1 Replies

Locking Any File In PC From Others Access

Jun 22, 2010

How could I lock any file in my PC from others access? I am trying to lock some my video, picture, Excel and Word file in my PC by using Visual Basic. I am using Visual Studio 2008 to develop this application but I am unable to do this job. It'll be something like security utility application. Actually without me, some other people also using my computer and I am trying to lock their access in my personal file. And I wish to know the tools which I can use for this job. I am just a Beginner on this development field.

View 4 Replies

Locking Out Keyboard In Textbox

Dec 8, 2009

I am in the process of writing a pos for the first time for a friend for his new restaurant. I am need to allow users to input floating numbers only. How do lock out the keyboard?

[Code]...

View 9 Replies

SQL Transaction Locking Whole Tables?

Mar 7, 2012

I am trying to use a transaction for the duration that the dialog is open and then commit the changes once the dialog has been ok�d or rollback'd if canceled by the user.My problem is when I use the transaction it is locking the whole of the tables that I�m using to update and insert new records too.I update the record in the first (current) table and insert a new record into the second (history) table. Obviously this is causing me problems as I only want the transaction to lock the specific records i'm updating and not allow a new insert record with my PK associated to my that I�m updating, not lock the whole of the 2 tables.This is my code[code]....

View 3 Replies

Threading And Object Locking

Mar 22, 2011

I have a problem in a multi-threaded application where I'm getting deadlocked waiting for an object to beocme available.

[Code]...

View 1 Replies

VS 2010 Locking A Control?

Mar 12, 2011

In Visual Basic 6, locking a control would prevent the user from selecting a control without greying it out like disabling it would. Is there a way of doing this in Visual Basic 2010?

View 9 Replies

Writing To XML Log - File Locking?

Oct 15, 2009

Simple question. I have a log of actions that is in XML. When some action occures, the XML log is updated. I am using:Dim xmlData as XElement = XElement.Load( "DataLog.xml" )

to load the existing data. I then create a new XElement (NewData) and use:xmlData.AddFirst( NewData )Which puts the latest item at the beginning of the log. And finally, I write it out using:xmlData.Save( "DataLog.xml" )Ok, that all works fine. But there is no testing to see if anyone has (or is) updating the file ("DataLog.xml") during the process. This may result in lost data. Is there an accepted way to implement some sort of file locking structure that can be used to prevent this potential loss?

View 8 Replies

Writing To XML With File Locking

Nov 2, 2009

I have some code based on some previous posts that just won't work right.The code all runs without error.

-' strErrorLog holds a valid file name with full path
-' xmlNewError holds a valid xElement value

Using holdFile As New IO.FileStream(strErrorLog, IO.FileMode.OpenOrCreate, IO.FileAccess.ReadWrite, IO.FileShare.None)[code]When I step through the code, everything works.There is no error on the xmlError.Save call.However, the actual file is NOT updated.If I remove the "Using" commands and change the save to "xmlError. Save(strErrorLog)", then it writes just fine..It's got to be something really simple, but it's frustrating that I don't get an error message.But it does unlock the file..

View 1 Replies

.net - Selecting Only The Filled Controls And Locking Them?

Jan 13, 2012

This is the situation when there is a shift change and one record is started by one person and finished by another. What one has written another can't change but must finished a record. So u must lock only the combo boxes and text boxes that are filled. This code lockes all the combo boxes and text boxes and 2 check boxes (NEZAVRSENE_INTERVENCIJE and IZMENA_RASKRSNICE) by clicking on a NEZAVRSENE_INTERVENCIJE check box. Lets say I have combo boxes 1 2 and 3 and text boxes 1 2 and 3 and I have to lock only the ones that are filled. How do I code that another check box lockes just the filled controls?

[Code]...

View 1 Replies

IDE :: XML Documentation And Intellisense File Locking?

May 20, 2009

I'm currently having issues with the following scenario:

1. I will build several DLLs with "Generate XML Documentation" set.

2. The DLL and XML files are copied onto another server (the build drop).

3. The copy will fail as the XML files are being locked by other users referencing these DLLs from their open Visual Studio projects.

Note that this also occurs on a local computer; open up two Visual Studios and use reference paths to reference the Binary folders. You'll find that the refrencing instance of Visual Studio will lock up the XML files causing the first Visual Studio to have problems compiling.

1. Is this a bug in Visual Studio 2008? Why is it holding exclusive locks on these files from the other computers? Is there a fix for this?

2. Is there a way to "package" the XML file into the DLL? I've noticed a lot of other .NET DLLs in the world that include all of their comments INSIDE of the DLL. No XML files necessary. (unless they're not .NET dll's).We're doing a lot of framework development here and it's imperative to include the XML documentation... unfortunately we've had to disable it to allow new builds to trickle through.

View 1 Replies

Locking A ToolStripContainer Panel To Only Allow For One Row Of Toolstrips

Sep 9, 2009

Title says it all. I want the ToolStrips to remain on one row, and for the user to be able to rearrange on that row but not create additional rows. I tried using SetBounds on the LocationChanged event, if the user attempted to change the Y position it just sprung right back. However, this created some visual bugs, such as the mouse always jumping back to the location and the ToolStrips jumping around randomly (while dragging one, the other would hop around randomly on the bar...)

I also tried setting the MaximumSize of the toolstripcontainer panel, but it allowed the creation of a new row anyway (in which the toolstrips were hidden.) EDIT: Its been a few months, still no answers...is this even possible?

View 1 Replies

Locking Application To HWID And SmartAssembly?

Nov 27, 2010

1) How do I lock my application to user's HWID?I want it to work this way: when a certain user opens my app, it automatically scans for his hardware ID and lock the application to it so noone other than the user can use the app.

2) I'm planning to use SmartAssembly trial version to obfuscate my code, will this affect my application in any way? Like, crashing?

View 2 Replies

Locking Column To Resize Horizontal

Aug 12, 2011

I have created program that contain listview and it's have many column, I want user can't resize column until horizontal Scroll appear... I want user only can resize same size as listview.

View 5 Replies

Locking Individual Records In Access Through VB

Nov 16, 2010

I'm a bit of a newbie to using VB in Access, I have a database in which multiple people need to work specific problems which are separated into records from a form. What I want to have happen is that everytime a person changes the cboStatusName combo box to "Done", it will populate the current time into the DateCompleted field, and then it will lock both of these. Below is the code I'm trying to use through an event.

[Code]...

View 5 Replies

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

Program Locking When Performing Some Tasks?

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

VS 2008 Locking A Remote Workstation?

Sep 30, 2009

how can i lock a remote workstation?

View 1 Replies

VS 2008 Locking The Tab Page Of A Tab Control?

Apr 16, 2012

Is it possible to lock the tab page of a Tab control ? There are cases where a specific page should be shown and the user should not acctdentally change the tab page . I know I could set as False the property Enabled of the Tab control , but that would ... well actually would disable the page , which I don't want to ...

View 3 Replies

VS 2008 Read The Log File Without Locking It?

Feb 5, 2010

I'm writing a log parser which is reading a log created by a game. This log can be written to many times a second. My problem is that my program is preventing the writing of the log at times. Is there anyway I can read the log file without locking it?

Sub readLog()
If readyToRead Then
If FileInUse(fileName) Then Return
readyToRead = False

[code]....

View 4 Replies

VS 2010 Locking Usercontrol Focus

Dec 28, 2011

I'm trying to create a grid usercontrol.This means that when i press "UP" it goes to the cell above (...so on for all directions) tab goes to the right and enter goes down.Now all these keys (excluding enter) change control focus so i've got a problem using them.How can i lock focus on the control so that these keys won't change it and so that i can use these keys for other things?

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved