Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
Questionhow to fill the user/pass fields in the popUp window of the HTACCESS from c# [modified] Pin
vedmack3-Aug-06 11:11
vedmack3-Aug-06 11:11 
QuestionDropdown Buttons Pin
SoftcodeSoftware3-Aug-06 11:03
SoftcodeSoftware3-Aug-06 11:03 
AnswerRe: Dropdown Buttons Pin
Thomas Stockwell7-Aug-06 12:51
professionalThomas Stockwell7-Aug-06 12:51 
QuestionB&W Image filter Pin
Rogenator3-Aug-06 9:40
Rogenator3-Aug-06 9:40 
AnswerRe: B&W Image filter Pin
Ennis Ray Lynch, Jr.3-Aug-06 9:48
Ennis Ray Lynch, Jr.3-Aug-06 9:48 
QuestionWaitForInputIdle Question Pin
Mridang Agarwalla3-Aug-06 9:32
Mridang Agarwalla3-Aug-06 9:32 
QuestionHow to know if Word is running under Outlook in Add-in Pin
zhihongwang3-Aug-06 9:15
zhihongwang3-Aug-06 9:15 
Questiona little further with System.Threading.Interlocked class Pin
mikewinny3-Aug-06 8:58
mikewinny3-Aug-06 8:58 
ok so perhaps not c# specific but its the language im using so...
i have some (hopefully) thread-safe code that accesses some shared fields using the lock statement but im trying to avoid full-on locking.
i need to update a field only if the result does not exceed some other value.
i found the following code for simple value update (in the CompareExchange() example):
do {
   initialValue = totalValue;
   computedValue = initialValue + addend;
} while (initialValue != Interlocked.CompareExchange(ref totalValue, computedValue, initialValue));

now, if i use the following would it be properly thread-safe and do wot i need..?
do {
   initialValue = originalValue;
   result = initialValue + addValue;
   overFlag = result > maxValue;
   if (overFlag) result = initialValue;
} while (initialValue != Interlocked.CompareExchange(ref originalValue, result, initialValue));

overFlag is bool and would be used after the udpate code to determine whether to continue or not.
i cant quite get my head around it. Confused | :confused:

thanks in advance


I worship his divine shadow.

QuestionHow to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
glima3-Aug-06 6:53
glima3-Aug-06 6:53 
AnswerRe: How to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
Judah Gabriel Himango3-Aug-06 8:48
sponsorJudah Gabriel Himango3-Aug-06 8:48 
GeneralRe: How to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
glima3-Aug-06 10:23
glima3-Aug-06 10:23 
GeneralRe: How to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
glima3-Aug-06 10:28
glima3-Aug-06 10:28 
GeneralRe: How to reorder ToolStripMenuItems in a MenuStrip Programmatically? Pin
Stefan Troschuetz3-Aug-06 10:36
Stefan Troschuetz3-Aug-06 10:36 
QuestionA source (example) to do... Help ! Pin
bttf3-Aug-06 6:50
bttf3-Aug-06 6:50 
AnswerRe: A source (example) to do... Help ! Pin
Not Active3-Aug-06 7:40
mentorNot Active3-Aug-06 7:40 
GeneralRe: A source (example) to do... Help ! Pin
bttf5-Aug-06 21:47
bttf5-Aug-06 21:47 
GeneralRe: A source (example) to do... Help ! Pin
bttf7-Aug-06 8:53
bttf7-Aug-06 8:53 
QuestionA Little Problem in Single Instance Implementaion!!! Pin
RizwanSharp3-Aug-06 6:40
RizwanSharp3-Aug-06 6:40 
JokeRe: A Little Problem in Single Instance Implementaion!!! Pin
Not Active3-Aug-06 7:44
mentorNot Active3-Aug-06 7:44 
GeneralRe: A Little Problem in Single Instance Implementaion!!! Pin
RizwanSharp3-Aug-06 7:47
RizwanSharp3-Aug-06 7:47 
AnswerRe: A Little Problem in Single Instance Implementaion!!! Pin
Josh Smith3-Aug-06 8:49
Josh Smith3-Aug-06 8:49 
GeneralRe: A Little Problem in Single Instance Implementaion!!! Pin
RizwanSharp3-Aug-06 19:36
RizwanSharp3-Aug-06 19:36 
QuestionGetting the installation directory in a Deployment project Pin
GazzaJ3-Aug-06 6:31
GazzaJ3-Aug-06 6:31 
QuestionStrange Problem Regarding TabIndex Pin
RizwanSharp3-Aug-06 6:22
RizwanSharp3-Aug-06 6:22 
AnswerRe: Strange Problem Regarding TabIndex Pin
Ingo3-Aug-06 6:35
Ingo3-Aug-06 6:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.