2,157 Posted Topics
Re: Lines 111-112 have a StreamWriter. Your request is vague. What does this StreamWriter you need to add need to write? | |
Re: Just use the [URL="http://msdn.microsoft.com/en-us/library/system.printing.printqueue.aspx"]PrintQueue[/URL] class. | |
Re: You'll need some sort of indicator that tells a thread that the item has already been checked, and a locking mechanism to prevent the threads from attempting to access that same object. You should probably read [URL="http://msdn.microsoft.com/en-us/library/c5kehkcz%28VS.80%29.aspx"]this[/URL]. | |
Re: Double has a very very large range, what exactly is your range requirement? Or are you confusing range and precision? | |
Re: What event handlers have you created and what code is in them? | |
Re: I can create a folder named 'com' on the desktop. What OS are you using? | |
Re: [QUOTE=DaveTran;1323562]In C++ the ternary operator below will return 1. [CODE] true ? 0 : 1 [/CODE] In C# it will return 0.[/QUOTE] You need to recheck that, it returns 0 in C, C++ and C#. | |
Re: If you store objects (reference types) in your List/Array then this behavior will happen automatically. When you store value types (int, bool, float, etc.) then this behavior doesn't happen. You can convert a value type into a reference type with explicit casting (known as [URL="http://msdn.microsoft.com/en-us/library/yz2be5wk.aspx"]boxing[/URL]), but changes to the original … | |
Re: The first [b]clsSerial[/b] is telling you what type of object is going to be returned by this method. The second [b]clsSerial[/b] is [URL="http://msdn.microsoft.com/en-us/library/ms173105%28VS.80%29.aspx"]casting[/URL] the value returned by [URL="http://msdn.microsoft.com/en-us/library/b85344hz.aspx"]format.Deserialize()[/URL] into a [b]clsSerial[/b] object. | |
Re: I can think of two ways to quickly do this, one using [URL="http://msdn.microsoft.com/en-us/library/system.string.split%28VS.71%29.aspx"]String.Split()[/URL] and the other using [URL="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx"]Regex[/URL]. Take a look at those and see what you can come up with. | |
Re: Your C# code looks fine, the error you are getting is saying that there is something in the textbox that is not part of an integer (spaces, letters, something). I'd put a break on the first Parse() line and take a look at what is in the qty100 and price100 … | |
Re: [code]void cPc() { Random trytg = new Random(); int trytg1 = trytg.Next(0, 9); Boolean r = true; while (r == true) { if (pictureBox1[trytg1].BackgroundImage == null) { pictureBox1[trytg1].BackgroundImage = y; pTur = true; r = false; } } }[/code] Line 3 gets your random number, but you never get another … | |
Re: A connection to a database has resources that aren't managed by the CLR. These are owned by the OS, and if you don't dispose of the object, the OS doesn't know that it's ok to clean up those resources. Also, the Garbage Collector runs when it 'feels' it needs to, … | |
Re: It's been a while since I've done file IO in C/C++, but doesn't it require that you read the EOF before file.eof() is set? What I believe is happening is this: 1. while (!file.eof()) // first time here, so it's not EOF 2. file.read(...blah...) // read the file into the … | |
Re: Was this code provided to you and you have to add the functionality that you state, or is this all your code? If this is all your code, do you know what an array is? | |
Re: The reason is that when you do the first resize only the Form1_Resize method is being called so your 'a' and 'b' variables are equal to zero. Set them somewhere else, like in the Form_Load event. Also, replying to your own thread over and over again makes it less likely … | |
Re: [QUOTE=drake10k;1319884]Hello, I'm receiving an error message (ArgumentException was unhandled - Parameter is not valid) when I'm trying to capture a portion of the screen with a rectangle. It works great when drawing the rectangle with clickPoint.X < lastPoint.X and clickPoint.Y < lastPoint.Y, but when lastPoint.X or/and lastPoint.Y is lower than … | |
Re: Show your code where you get and construct the query string, it will make it easier to understand and help you :) | |
Re: You can't create an interface that has to be a class because then it wouldn't be an interface. Abstract class is the way you'll have to go. Also, why do you consider it to be unlucky to have to use an abstract class? | |
Re: [code]SqlConnection myConnection = new SqlConnection(<connection string>);[/code] <connection string> in the basic form looks like this: [code]"Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;"[/code] You can see other formats at [URL="http://connectionstrings.com"]ConnectionStrings.Com[/URL]. | |
Re: You aren't very clear, what "doesn't work" since you get no errors? You do realize that the Regex you are creating only has scope inside the if, once you leave that there is no Regex? | |
Re: You'll have to load the tiff image as a BMP thn get the graphic object from that. | |
Re: IIRC, Access doesn't support @ parameters, you have to use ? and then make sure you add them in order: [code]cmd.CommandText = "insert into Trace (DS_ID,D_ID, Trace_Type, T_Amount, T_Date, VIN) values (?, ?, ?, ?, ?, ?)";[/code] | |
Re: From the same site you linked: If you receive a SocketException, use SocketException.ErrorCode to obtain the specific error code. Once you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. | |
Re: Every book I've read on C# has this in it, and it would be much easier for you to find a book than to explain all the code you have to right. | |
Re: Some optimizations for your loops could be done, take your xDivisions loop: [code]for (int x = 0; x <= xDivisions; ++x) { a.X = x * cellSize; a.Z = z * cellSize; b.X = a.X; b.Y = yDivisions * cellSize; b.Z = z * cellSize; DrawLine(a, b, color); }[/code] Lines … | |
Re: According to Microsoft, this happens when you didn't completely uninstall a beta version of their software before installing the release version. Otherwise, they want you to fill out a form reporting the issue at [url]http://lab.msdn.microsoft.com/ProductFeedback/reportbug/search.aspx[/url] | |
Re: You can attach event handlers to the VerifyingUser/VerifyingAnswer events and handle this yourself. | |
Re: In your 2nd code example, you realize that you are setting each of those parameters to the literal strings you are supplying, not to values stored in variables of those names? While the first 4 would be fine (they are VarChar), the last one would not as "DateSent" can't be … | |
Re: I suspect it is having to make a call to YouTube on each iteration of the IEnumerable. | |
Re: What does it do? Do you get an error? Are you sure it didn't open (sometimes it opens the project but doesn't display any windows, check the project tab). | |
Re: [QUOTE=buster2209;1311512]How can I do a SortOrder for the [I]second[/I] column?[/QUOTE] Provide your own ListViewItemSorter method, you can see an example [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.listviewitemsorter.aspx"]here[/URL]. The example shows how to sort based on clicking the column header. | |
Re: Please provide me with money to waste my time writing code for you. | |
Re: On which line is the exception thrown? What error are you getting? What is the value of TextBox1.Text? | |
Re: Posting it on the GeckoFX support site would be my first action. | |
Re: There is overhead with a SQL type database. Using a file based system allows them to avoid that overhead at a cost of performance (and limited size). Splitting the tables into different files enhances performance, as you don't have to read what you don't need (I suspect they also use … | |
Re: Because of the way you created your equation, your 'z' axis is what we'd traditionally refer to as the 'x' axis. I believe that is causing your problem. As for checking to the right, does the check wrap around the cube? For example, if I'm at the far right of … | |
Re: [code]int myNumber = Int32.Parse(str.Trim().Substring(0, str.Trim().IndexOf(' ')));[/code] This will attempt to convert the first text of the string into an integer. Leading spaces are ignored. If you know you don't have leading spaces, remove the Trim() calls. | |
Re: tmpInc is an object, and you are storing a [b]reference[/b] to that object in the list (you are not making a copy of the object). So when you change the values in the object you get this affect. You need to create a new object each time: [code]for (int x … | |
Re: How are you combining them? Can't debug code we can't see. | |
Re: Lines 24-34 aren't in your psuedocode (and I believe they are causing your problem). What are you trying to accomplish with them? | |
Re: String.Split contains an overloaded method that uses Strings as delimiters: [code]string[] sections = line.Split(new String[] {"><"}, StringSplitOptions.None);[/code] | |
Re: You should use File.ReadAllLines(), it will make it shorter and will work with however many lines you put into the file: [code]songs = File.ReadAllLines(playlist);[/code] | |
Re: Create 2 'pointers', one to the start of the queue, one to where the next one will go. When you add an item, check to make sure the start and end aren't the same (if they are, then your queue is full. How you want to handle that is your … | |
Re: Depending on what you need to do, you put it in the FormClosing or FormClosed event. | |
| |
Re: [code]/// <summary> /// Rounds a number to the closest multiple of another number. /// </summary> /// <example>83 rounded to closest 25 would give a value of 75 (83 is closer to 75 than 100)</example> /// <param name="num">The number to be rounded</param> /// <param name="closest">The value you wish to round to … | |
Re: You'll need to get XNA if you want to do DirectX in C#. They stopped the original managed directx a long time ago. Check out [url]http://msdn.microsoft.com/en-us/aa937791.aspx[/url] for more info. |
The End.