624 Posted Topics

Member Avatar for lxXTaCoXxl

Unless this code is running multithreaded, if the player is firing in automatic mode the code will be completely blocked forever, since the bool argument will not change once inside the while loop. If it is multithreaded, this class instance will lock up in automatic mode, eventually throwing an overflow …

Member Avatar for lxXTaCoXxl
-1
248
Member Avatar for srm2010

Your code is really confusing. But I suspect that your error is caused by setting a string to an number or vice versa. Determine the data types of all those fields (maybe give them more meaningful names too). Compare these types to what you are providing them - in this …

Member Avatar for skatamatic
-1
132
Member Avatar for vigneshkbv

In the first snippet it seems like you are setting the .Tag member of the entire datagrid, not the individual cells/rows. In the second snippet you are accessing the first index of the selected cells, then trying to get the tag member out of it's parent gridview. I would try …

Member Avatar for vigneshkbv
0
276
Member Avatar for lxXTaCoXxl

Neat little snipet. 1 Thing though. The max speed of a winforms timer tick event is actually about 20-30ms, so setting it to 1ms is actually just taxing your cpu a bit more than is necessary.

Member Avatar for lxXTaCoXxl
2
175
Member Avatar for abelLazm

I was hoping to see an actual compression algorithm, not an implementation of one you didn't write...

Member Avatar for skatamatic
0
874
Member Avatar for Mike Askew

Look into the System.Threading.Thread class and the System.Threading namespace to run code in parallel. .Net 3.5 and up also have something called a TaskFactory, which handles a lot of the overhead and complications that can arise when making multithreaded apps. I typically do all the threading myself, but my cooworkers …

Member Avatar for Mike Askew
0
245
Member Avatar for sachintha81

If it's an old DLL (pre .Net) you need to use regasm "path to dll" /codebase /tlb:YourTLBFileName.tlb. This will register it for a COM interop. I think the default place that programs look for dlls (unregistered ones) is in Windows\System32. If you really want, try just copying the DLLs there.

Member Avatar for sachintha81
0
3K
Member Avatar for Johan__

You have a closing bracket on line 31 that should be an opening bracket { . Also, you will need a closing bracket on line 53 and 71.

Member Avatar for ReshmaRajan
0
163
Member Avatar for blackhat416
Member Avatar for lxXTaCoXxl

Why would the birth ever be nullable? Once the object is initialized, is this not its birth time?

Member Avatar for lxXTaCoXxl
0
1K
Member Avatar for DarthPJB

Here's something I wrote a while back to do just this with some data aquisition dll. The reason I had to load/unload it dynamically is because the driver was broken, and would keep the same device handle after the device was unplugged. When you plugged it back in, the handle …

Member Avatar for thines01
0
816
Member Avatar for saneeha.nust

Just to keep you from getting excited, I don't have your answer. But really, that's a good thing. I don't think it would be a good idea to post on a publicly viewable, high traffic website like this a way in which a person can hack the windows OS in …

Member Avatar for BobS0327
0
138
Member Avatar for kshahnazari

Well if you keep track of all the shapes drawn, and use something that can be converted into a region (like a GraphicsPath) then you can use [code] Graphics g = myForm.CreateGraphics; g.FillRegion(myBrush, new Region(myGraphicsPath); [/code] But chances are you wont be keeping track of every object. To work directly …

Member Avatar for skatamatic
0
123
Member Avatar for winnitbaker

Without using Linq, this should work: [code] List<string> outputStrings = new List<string>(); using (StreamReader sr = new StreamReader(filepath)) { //file 1, read everything while (!sr.EndOfStream) outputStrings.Add(sr.ReadLine()); sr.Close(); } using (StreamReader sr = new StreamReader(filepath2)) { while (!sr.EndOfStream) { //file2, read a temp string in, if the outputstrings doesn't contain it, …

Member Avatar for skatamatic
0
99
Member Avatar for shandoosheri

Easiest way I can think of would be to crank the contrast up internally, then go by color on this high contrast image to look for edges (of a ball, in this case). For just a rectangle this can be a relatively fast calculation: -Find the leftmost pixel of color …

Member Avatar for shandoosheri
0
563
Member Avatar for sudheer2250
Member Avatar for skatamatic
0
150
Member Avatar for behemothdave

[URL="http://msdn.microsoft.com/en-us/library/system.char.isnumber.aspx"]Char.Number[/URL] and various other [URL="http://msdn.microsoft.com/en-us/library/424s1h3z.aspx"]Char static members[/URL] might be worth looking into. Also, if you want to get deeper into string parsing, look into [URL="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx"]regular expressions[/URL]. A few [URL="http://msdn.microsoft.com/en-us/library/system.double.tryparse.aspx"]double.tryparse[/URL]()'s would do the trick here too.

Member Avatar for behemothdave
0
199
Member Avatar for Johan__

[QUOTE=thines01;1737144]Take the calculateValues method OUT of the Readinput method. You have them nested together and that will give you an error. Also: 1) Change your "finalprice" to a double. 2) Add a constructor[/QUOTE] What's wrong with using a decimal here? They are much more accurate within a reasonable financial range …

Member Avatar for thines01
0
94
Member Avatar for Cameronsmith63

Datagridview's have an event that you can handle that will let you know if the databinding is complete. Something like .DatabindingComplete. If you handle this, have it set a boolean flag to true when you know the control is done with the databinding. This will let you know that the …

Member Avatar for Cameronsmith63
0
163
Member Avatar for Arjun_Sarankulu

Why would you want a client and server to run on the same machine (other than for development purposes, of course)?

Member Avatar for Arjun_Sarankulu
0
220
Member Avatar for jemz

Start with a winforms hello world app and take it from there. What other languages are you comfortable with?

Member Avatar for jemz
0
211
Member Avatar for newbiecoder

Are the numbers entered on the same line? If so, what are you delimiting the numbers with? If it's on 2 seperate lines of entry: [code] double myNumber = 0; if (double.TryParse(myString, out myNumber) == true) { //The cast worked, myNumber now contains a double parsed from the string } …

Member Avatar for newbiecoder
0
141
Member Avatar for zismad

I think windows 7 starter only comes bundled with .Net Client Profile 3. You may be referencing a different framework - probably the full blown framework (3.5 or 4). When you run the program, does it appear in the process tab of task manager?

Member Avatar for zismad
0
216
Member Avatar for sat21091

You could use the .Tag property of each button to give it a coordinate. Then subscribe all the buttons' events to one event, and use this coordinate to identify the button. in drawchessboard: [code=csharp] b[i,j].Tag = new Point(i, j); [/code] [code=csharp] private void abc(object sender, EventArgs e) { Point ButtonCoordinate …

Member Avatar for skatamatic
0
200
Member Avatar for glut

That seems like a very CPU expensive loop to poll for mouse clicks. It has to go through hundreds (maybe even thousands) of enums, poll the GetAsyncKeyState, filter the results, then set flags. An event would have a LOT less overhead. As for why it's not working - I have …

Member Avatar for glut
0
138
Member Avatar for suneye

This depends. Are you familiar with other languages and interfaces (win32, sockets, multithreaded apps, etc). If you are, then it will just be a matter of syntax and which classes to use. If not, you will spend a lot of time banging your head on your keyboard like the rest …

Member Avatar for suneye
0
117
Member Avatar for Peelu pags

What library are you using? Are you familiar with graphics? (Coordinates, etc). Did the library you are using come with documentation? You've given us very little to work with lol.

Member Avatar for Peelu pags
0
153
Member Avatar for DavidKroukamp

That would probably the smallest possible packet - though you should delimit each word with a special character that is not typeable (null perhaps). Then split the string based on this character with String.Split(). Another, more OOP friendly way but with much more overhead, would be to look into sending …

Member Avatar for skatamatic
0
255
Member Avatar for galhajaj

As of now, there's only a small handful of commercial games that are written using the XNA framework. Not to discredit it - it is a pretty good interface in my opinion. The problem is, however, due to the lack of commercial use I fear it might not be around …

Member Avatar for thines01
0
112
Member Avatar for Behseini

You need to get the redistributable assemblies that correspond to your devexpress components. Then bundle these with your installer (if you have one made) and if not you will have to manually install and register them.

Member Avatar for skatamatic
0
335
Member Avatar for lxXTaCoXxl

In properties, you can set get/set to a specific accessor (private, internal, protected, public,readonly, etc) So, [code] private set{ this.label1.ForeColor = value; this.label2.ForeColor = value; this.label3.ForeColor = value; } [/code] Will probably do the trick. As for resizing, you can use the SizeChanged event to trigger a method that dynamically …

Member Avatar for skatamatic
0
77
Member Avatar for Momerath

I heard that they are only releasing a 32-bit dev preview, and the 64-bit one comes with no development tools.

Member Avatar for Pjieter
1
336
Member Avatar for auwi987

In the SQL query, you can assign aliases to column names. This is probably the easiest method. I totally forget how to do this, but I'm sure google can help you out with it.

Member Avatar for M.Waqas Aslam
0
127
Member Avatar for ddanbe

This would work - but there's a few other ways to skin this cat. A line with the start and end points being the same would draw a single pixel. A elipse with size 0 would also draw a pixel. Same with a rectangle. If you draw your function with …

Member Avatar for skatamatic
0
4K
Member Avatar for galhajaj

A delegate is the .Net equivalent of a function pointer. Basically it describes a function/method to be called (return type, parameters count, and parameter types) without actually being a function - sort of a prototype of a function/method. These allow your code to be able to describe a function without …

Member Avatar for thines01
0
146
Member Avatar for shandoosheri

You need to capture the MouseDown and MouseUp event, set a boolean, and remember the original coordinates: [code] bool MouseIsDragging = false; point Start = new point(); private void MyForm_MouseDown(object sender, MouseEventArgs e) { MouseIsDragging = true; Start.X = e.X; Start.Y = e.Y; } private void MyForm_MouseUp(object sender, MouseEventArgs e) …

Member Avatar for shandoosheri
0
140
Member Avatar for unreal04

Looks like you should read into inheritance and polymorphism. Are you familiar with these concepts?

Member Avatar for unreal04
0
98
Member Avatar for Tipples
Member Avatar for tungnk1993

I don't understand why people post solutions that they just googled themselves, when it would be just as easy for the OP to do the same....

Member Avatar for skatamatic
0
136
Member Avatar for jain1.anuj
Member Avatar for u.j.chandler

[QUOTE=Tellalca;1726268]Delegates are not very powerful indeed. As you said, it is a master method that calls other methods when a specific condition happens. What it brings to the table is it has a subscription list. So if you do not know which functions to call while you are writing this …

Member Avatar for skatamatic
0
184
Member Avatar for yash_code

Yikes. Not only is that really hard to look at due to missing code tags, the code itself is terribly written! As for the printing problem - it seems more like a problem with printer configuration than with code. Try playing with your printer's page settings.

Member Avatar for yash_code
0
301
Member Avatar for sam1

I'm not sure it's possible to disable ctrl+alt+delete (not easily anyway). But you CAN disable task manager in user profiles (or just poll for taskman.exe and kill it). Also, killing explorer is an option as well - you can just relaunch it after the proper user entry. This way if …

Member Avatar for sam1
0
1K
Member Avatar for niggz

You have logic built into your 'Get' that tells it to increment every member variable by 1.... You must realize that the locals window uses this 'Get' when you try to get your values out of the class, therefore incrementing them each time you hover over it. You can fix …

Member Avatar for skatamatic
0
137
Member Avatar for drewos

Ummm I am a bit confused by your code. But to make a list of classes: [code] class myClass { //Class implementation } //now to make a list of this class somewhere else... List<myClass> myClassList = new List<myClass>(); myClass myClassInstance = new myClass(/*ctor stuff*/); myClassList.Add(myClassInstance); //or, alternatively myClassList.Add(new myClass(/*CTOR stuff*/)); …

Member Avatar for skatamatic
0
135
Member Avatar for DevNet

[QUOTE=DevNet;1715649]Thanks for that one! :) Im gonna try it.. oh and by the way, I was wondering if after this is successfully compiled, is there a way wherein I could match/compare two images that have been clicked if they are matched or not a match? Since I am doing a …

Member Avatar for Mike Askew
0
1K
Member Avatar for kamilacbe

If this is a mock real-world application then you should [B]absolutely[/B] save it in a database. Wouldn't be much use to have local datafiles that no one else can access. The type of database is up to you, but relational ones (such as InnoDB) are easy to use, well documented, …

Member Avatar for kamilacbe
0
107
Member Avatar for LateNightCoder

I like using dictionaries for things like this: [code] dictionary<char,int> myDict = new dictionary<char,int>(); foreach (char c in myString) myDict[c]++; [/code] You should also note that in C# pointers must be used in an unsafe context (they will throw exceptions otherwise). And really there's not a lot of good reasons …

Member Avatar for thines01
0
234
Member Avatar for tom92united

Do you HAVE to use arrays? They aren't exactly tuned performance-wise for remove operations. A linked list or binary tree would be the ideal datastructures here.

Member Avatar for thines01
0
216
Member Avatar for Panathinaikos22

[QUOTE=ddanbe;1715571]You could start here: [url]http://msdn.microsoft.com/en-us/library/ms747437.aspx[/url][/QUOTE] If you are intending on using this for a game, I would go with Direct X or OpenGL over WPF.

Member Avatar for Panathinaikos22
0
118

The End.