Answer Questions
David Inman Recompile causes IDE Crash
I have written my own control that inherits from the System.Windows.Forms Control object. It is basically something that had to be written in order for the developers I work with to plug a visually interactive interface into their apps. It is a lot like the WinForms treeview in appearance. The Problem: When ever anyone writes a control that inherits from this control, if they have the desinger open to view it and they build, the IDE crashes. Does anyone have any clues as to what is happening here. I am sure it is something to do with me not understanding how to develop a control that is ment to be used by the desinger. Something with the componant model or something like that. I am reading all I can to figure it out, but if anyone has any ...Show All
redneon extracting data from comma delimited string
hi, im using c#, have a comma delimited string and i wish to split it. string example is: john smith, freddy, mark/,jones, john i don't wish to split where a comma is backslashed. any ideas thanks. andrej, your latest code gives me this: john/,smith becomes john/ roger/,wilco becomes roger/ Any ideas Hi, you didn't write how you want your string to be split... anyway, how about this piece of code...: string values = "TechRepublic.com, CNET.com, News.com, Builder.com, john/, smith, GameSpot.com" ; string [] arrayOfValues = values.Split( new char [] { ',' , ' ' }, StringSplitOptions .RemoveEmptyEntries); A ...Show All
LuckyL on creating MDI forms
I created a MDI parent form but when I placed 2 MDI child form under the parent form and ran the application, the vertical and horizontal scrollbar appeared How to make those scrollbars disappear from my MDI parent form thanks in advance :) I wan to click a button on the child form and it goes to another child form, how do i go about doing that lets say child form 1 is f1 then child form 2 is f2 and from f1 when i clicked the button on it will go to f2. how do you do it In the click event handler of the button in the first child form (i.e. f1) use the code something like below. frmChild2 f2 = new frmChild2(); f2.MdiParent = this.MdiParent; f2.Show(); (Assuming frmChild2 is the second child ...Show All
nagual20 W3wp.exe Application Error - Exeception breakpoint - break point has reached
Hi All, We are getting following error message on our Win2003 server. "W3wp.exe Application Error - Exeception breakpoint - break point has reached". We are running the Asp.net2.0,1.1 and SQL 2005 and IIS6.0. for this application is pointing Asp.net1.1 and sql 2005 and we are added one ISAPI filteration for SEO friendly URL. We are getting above error message.... AOur application is not ruuning... For ISAPI filtration dll, we are used VC++ -> MFC6.0. Error Message in Detail ----------------------------------- W3wp.exe Application Error The Exeception breakpoint break point has been reached (0x80000003) occured in the application at the location 0x7c82 ...Show All
mohdtmn when to use "static"
When creating business applications that have you know 3 layer design as far as Data Access, Logic, Presentation.....Why would you want to use static methods in your logic and data access layers...what are some benfits of having static methods something like that, as simple as that may sound, remember there is memory and processor overhead involved in creating an instance of the the "objectname" that are not needed when executing the returnstr() function, thus it provides a proformance advantage to not have to create the object just to use the functionality that it exposes. Static methods give you the opportunity to expose functionality that does not require an instance of the related object. Specific math functions ...Show All
Mike Krysl Question about threads
I created a socket and am asynchronously listening to a TCP port. This calls a method in another thread when a connection comes in, which puts the data into a buffer and sets a boolean variable to true. Is it safe to fill a buffer and set a boolean value from this other thread If so, how can I set an event when a boolean variable is set to true (in the main thread) to alert my code that data is there Or is there a better way to do this Thanks for any help. Hi, as Brendan mentioned this is a good candidate for a producer/consumer scenario, I gave a simple example of how to do this in the following thread: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1113365&SiteID=1 it might be ...Show All
Barrios Window closes automatically when debugging
Hi, I'm new to this forum and developing so if I don't adhere to a protocol, let me know! Using the Visual C# step by step book, I created a Hello World windows application with using a Form, OK button, label and input box, and when I run Debug or Start without debugging, the window appears for a split second and then goes away. It didn't work when I first created it, then, when I toggled some system restore points, it started working! After waking my comp from hybernation today it's back to not working. Any help is greatly appreciated. Here are my stats: Win XP SP2 Visual Studio 2005 .NET Framework 2.0 Hi, I figured out some sort of workaround, or maybe a fix, but I changed the directory of the s ...Show All
DrBrain Compare 2 Strings of Diff Length
I am looking for the fastest comparison which will start from the left of one string, and return true if ALL the characters of the first string match the first x characters of the 2nd string where x is the length of the first string. For example: String s1 = "YI" ; String s2 = "YIPES" ; String s3 = "Y" ; s1 = s2 would return true s1 = s3 would return false This would be part of a larger loop, so I am looking for the fastest comparision method. Regex maybe Many thaks Mike Thomas s2.StartsWith(s1) returns true. s3.StartsWith(s1) returns false. You can also specify case-sensitivity and culture information. Thanks very much CommonGenius. Mike Thomas ...Show All
Woyler Dropdownlist can not clear textboxes after an insert
My problem is this: I display a number of IDs using 5 Dropdownlists inside a FormView. The dropdownlists are fed by SQLdatasources to retrieve the IDs. To display blank entries during the initial presentation of the dropdownlist, I use the code below which works fine during the Page_Load and whenever I click the Cancel button. However, whenever I click the insert button to insert a record, the dropdownlist will not work with the code below no matter where I put it. If I put the code below to execute after the inserted event of the FormView, the code never clears the dropdownlists . If I place the code inside the insert button click, it clears the dropdownlists before the record ...Show All
SoMe-WhErE-oVeR-yOnDa Code generation
Hi, I am looking for information on code generation. I am designing an application that has many methods and textboxes i.e. a lot of repetitive information and was told to use code generation using xslt or something. Do you perhaps know where I can find more information about this and also how I should go about preparing myself for this strange concept. Thanks I prefer MyGeneration ( http://www.mygenerationsoftware.com ). Very similar to CodeSmith, but the free version does more. Code Generation in Microsoft .NET by Kathleen Dollard is an excellent resource if you have a book budget. I am not affiliated in any way with APress. Mark take a look here for generating .NET code on runtime http://msdn2.microsoft ...Show All
tackett Global access to arrays
Hi, I am a beginner at C# and am probably trying to run before I can walk! However, I need to build an application which has several Forms. I was brought up on the concept of only writing code once and using it everywhere. So, What I need to be able to do is to: Hold data arrays in one piece of code, say MyData.CS and access it from all of my Forms. Hold pieces of code,( like subs in VB ) which perform specific tasks and which are, again, accessible from all my forms. these may access the API or just do general stuff. I can write the code, but I just can't access it. So far, I have been able to handle single point variables in this way, but I don't seem to be able to do the same with arrays. Also, I can never access my 'g ...Show All
Tduffy77 Using a progressbar via another class
I have written a program that splits a XML file with it's own class called SplitXML with a SplitFile(). This method has a nested do/while loop that starts at 0 and iterates until the end-of-file. My desire is to access the progress of this loop in another form which will have the progress bar. I could move the SplitFile() into this form with the progress bar, but that would invalidate the class, as I feel I am no longer performing "OOP". I access this class also in a windows service I have created, this SplitXML class appears as "Complete" Object as it is re-usable. I have had a look via Google on Delegates and possibly Multi-Threading but it seems to me that there MUST be an easy way to access the progress of this loop ...Show All
Tom_Liu Issue with ASP.NET C# Textboxes not retaining their new values
Here's the scenario: I have a web form with text boxes. Those text boxes are populated on the page_load event. User can edit these boxes and update their values. Problem is whenever the update button is pressed, the new values that the user may have entered into the textboxes is seemingly erased. The textboxes only remember what they were set to... it's like they are static. You can type into them, but their text property on the code-behind page does not show that they have been changed, and as thus no changes ever hit the database. I put the text boxes onto the form. The only property I changed was the name property of the text box. Any ideas on how to fix this Given that you are talking ...Show All
Jonty-UK BeginInvoke and resource leaks
From Jeffrey Richter's "CLR via C#": "You must call Endxxx or you will leak resources. CLR allocates some internal resources when you initiate asynchronous operation. If Endxxx is never called, these resources will be reclaimed only when the process terminates." This is written about functions like BeginRead and EndRead. Is this correct also for delegates For example: public delegate void SomeDelegate; ... SomeDelegate someDelegate; ... someDelegate += subscription; ... someDelegate->BeginInvoke(); If I never call someDelegate->EndInvoke, does this create resource leak, as written in the book According to Richter, the only Beginxxx function which doesn't require Endxxx is Control.BeginInvoke. I can use Control.BeginInvoke ...Show All
Vania B Generic 2.0 and Predicats
Hi, I have a list<MyStruct> and would like to use it find a struct in the list. let's say .. struct MyStruct { string _name; public string Name {...} } i'd like to use list<T>.Find(Predicat<T>) with the property Name of the struct. How can i do so Thanks, I've seen the example but its not enough .... the example use a delegate that compare a string staticly ... i don't wanna do something like public static bool Found(MyStruct s) { if(s.Name == "theOne") // Is there a way to do depending on a string i am looking for {return true;} else {return false;} } Like the list contains 20 MyStruct ... and i wanna search if in those 20 there's a MyStruct that has a nam ...Show All
