locked
I need help with Microsoft Visual C# 2010 Express RRS feed

  • Question

  • Me and my friends have created multiple mazes...we have found a few bugs and would like to know how to correct them..... For example you can hit f10 and move mouse from start to finish hit f10 again and you win or you can left click and hold and move mouse from start to end and still win....is there a way to make it where you can't use left click or f10 without reseting....or any ideas on how to counter this???

    Wednesday, July 27, 2011 6:59 AM

Answers

  • Hi,

    without knowing anything about your code I don't think that we can really help you in detail. If we compare it to programing, then all we got is a "My car is not driving" and we told you what you could check e.g. "Do you have fuel in the tank?" and such things. But without more details, we cannot help you to much.

    We could write you a lot of suggestions e.g. complete descriptions about different things, but that could be very hard and this is a forum and not a place like a blog where you can put very long, detailed descriptions.

    But I can give you some links:

    - Did you check all (or at least all mouse and key) events to see, what information you get from them? http://msdn.microsoft.com/en-us/library/system.windows.forms.form_events.aspx

    - You know how to set up fields in your form (e.g. lastMouseLocation) so in any event where you get the mouse position you can compare the new position with the old one and afterwards store the current position as the old position.

    - You found some algorithm already to find out if a wall is on a line between 2 points? (We cannot help as long as we do not know your data. If you have a gamefield of 20x20 fields: Are walls just lines between 2 fields or is a field filled with a wall? Dependend on that you could think about the algorithm. And maybe you need some mathematics knowledge, too.)

    - Maybe you need some more information about handling the mouse. Maybe the Form events are not enough (I don't think so, but I didn't do full tests so far). On www.codeproject.com are a lot of articles regarding that. I just did a search on "mouse c#" there and got a long list of interesting articles. But at the moment I would think that the standard events should be good enough already so that no tricks are required.
    http://www.codeproject.com/KB/cs/Auto_Clicker_Bar.aspx (includes mouse movement / positioning)
    http://www.codeproject.com/KB/library/InputManager.aspx (a complete library for handling user inputs.)
    http://www.codeproject.com/KB/DLL/WindowsHookLib.aspx (Description of window hooks - you should have understood code you are using from others else you have a point of failure in your program where you cannot debug!)

    At the moment I cannot think of more points that I can generally describe (or find some desription on the net for you). In general I would say that MSDN Library and CodeProject are two great locations to search on some topics. (I would suggest to also try to search yourself more. It is just a litte practice and then you will be able to find solutions to a lot of problems on your own!)

    And of course: You are welcome in the foums here. We are willing to help you. But please provide some code parts where you have problems. Or at least more details what your program is doing and what is going wrong. Maybe you can upload the full project as a ZIP somewhere and provide us a download link. (I don't have much experience with that but there are sites like rapidshare.com. Not sure if they still provide free uploads/downloads....)

    With kind regards,

    Konrad

    • Marked as answer by Cookie Luo Thursday, August 4, 2011 6:03 AM
    Sunday, July 31, 2011 8:02 AM

All replies

  • No you cannot edit an existing program with Visual Basic 2010 Express C#. 

    For that you have to contact the builder of the program.

    (Be aware Visual Basic 2010 Express C# does not exist, Visual Basic and C# are two different program languages. For both is a freeware packed available to create programs which is called Express)

    Take a look at these pages.

    http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express

    You are now asking questions in the forum for Microsoft C# programming.

     


    Success
    Cor
    Wednesday, July 27, 2011 7:06 AM
  • I actually meant Microsoft Visual C# 2010 Express....lol its 3am and been staring at coding in the mazes for way to long..sorry about the confusion...
    Wednesday, July 27, 2011 7:07 AM
  • What are yo doing exactly? If you have the full code of the maze, then you can debug it. Just start the maze from within Visual C# Express after setting some breakpoints.

    And you can alwaysm odify the source and recompile again.

    But as Cor said: if you are using finished work where you just have the assemblies, then you cannot (easily) do any changes to the code used and it would be easierst to ask the developer to fix the bugs or share the source code.

    Maybe you want to give more details what you are doing exactly.

    With kind regards,

    Konrad

    Wednesday, July 27, 2011 7:16 AM
  • What are yo doing exactly? If you have the full code of the maze, then you can debug it. Just start the maze from within Visual C# Express after setting some breakpoints.

    And you can alwaysm odify the source and recompile again.

    But as Cor said: if you are using finished work where you just have the assemblies, then you cannot (easily) do any changes to the code used and it would be easierst to ask the developer to fix the bugs or share the source code.

    Maybe you want to give more details what you are doing exactly.

    With kind regards,

    Konrad

    We have made a program with different maze difficulties... so you can do beginner, intermediate..etc....we put lives and timer...you hit walls you lose lives and you lose time...the walls work if you hit them with mouse putting you back to start point...the issue is if you actually run the the file as a .EXE then you can left click and hold the button down and move from start to finish and release button....allowing people to cheat to win bypassing all the walls and not really having to solve the maze... Does that help out a little more....? We have modified some of the source to fix other issues and this is one issue we can't seem to figure out how to correct in the code....
    Wednesday, July 27, 2011 7:20 AM
  • Ok, so you created the whole program. You are the developer and you have the full source code. So maybe the idea to debug the program is helpfull.

    But without any details what you did in your code, we cannot really advice you. All help I can provide is to give you some general hints.

    What mouse events do you evaluate to track the mouse movement? What checks do you do? Dou you just test like "Is the current mouse position in a wall?" Some ideas could be:

    - Check that the line from the last known mouse point to the current point does not hit any wall. So moving somehow from start to end will hit a wall, too.

    - Do not allow big mouse moves. If the mouse was moved more than a special distance, then you move the mouse back to the last known position. Maybe only do this if your form has focus.

    And if you do not get more mouse positions when the left button is pressed, then you should check the mouse events available. I am quite sure that it is possible to get more positions. Or just stop all movement when the mouse button is pressed. Like a "pause" function.

    There are a lot of ideas, but you have to provide more details what you are doing so we can suggest solutions. But maybe I found some ideas that help you already.

    With kind regards,

    Konrad

    • Marked as answer by Cookie Luo Thursday, July 28, 2011 7:06 AM
    • Unmarked as answer by GodSpeed790 Sunday, July 31, 2011 6:27 AM
    Wednesday, July 27, 2011 7:35 AM
  • Ok, so you created the whole program. You are the developer and you have the full source code. So maybe the idea to debug the program is helpfull.

    But without any details what you did in your code, we cannot really advice you. All help I can provide is to give you some general hints.

    What mouse events do you evaluate to track the mouse movement? What checks do you do? Dou you just test like "Is the current mouse position in a wall?" Some ideas could be:

    - Check that the line from the last known mouse point to the current point does not hit any wall. So moving somehow from start to end will hit a wall, too.

    - Do not allow big mouse moves. If the mouse was moved more than a special distance, then you move the mouse back to the last known position. Maybe only do this if your form has focus.

    And if you do not get more mouse positions when the left button is pressed, then you should check the mouse events available. I am quite sure that it is possible to get more positions. Or just stop all movement when the mouse button is pressed. Like a "pause" function.

    There are a lot of ideas, but you have to provide more details what you are doing so we can suggest solutions. But maybe I found some ideas that help you already.

    With kind regards,

    Konrad

    That is exactly how we want to do it...How would we go about stopping big mouse movements and also put a pause function on the F10 key and the left button for the mouse.....those are the ideas we needed thanks a lot Konrad! Now we have to figure out how to implement them....hehe
    Wednesday, July 27, 2011 10:38 PM
  • oh also forgot to mention on liking this idea to " Check that the line from the last known mouse point to the current point does not hit any wall. So moving somehow from start to end will hit a wall, too" cause that would be great. Thanks again!
    Wednesday, July 27, 2011 10:39 PM
  • So how what coding would i use to implement these ...and my answer is not solved until I figured out what the coding is to implement the suggested features.....Thanks

     

    Sunday, July 31, 2011 6:28 AM
  • Hi,

    without knowing anything about your code I don't think that we can really help you in detail. If we compare it to programing, then all we got is a "My car is not driving" and we told you what you could check e.g. "Do you have fuel in the tank?" and such things. But without more details, we cannot help you to much.

    We could write you a lot of suggestions e.g. complete descriptions about different things, but that could be very hard and this is a forum and not a place like a blog where you can put very long, detailed descriptions.

    But I can give you some links:

    - Did you check all (or at least all mouse and key) events to see, what information you get from them? http://msdn.microsoft.com/en-us/library/system.windows.forms.form_events.aspx

    - You know how to set up fields in your form (e.g. lastMouseLocation) so in any event where you get the mouse position you can compare the new position with the old one and afterwards store the current position as the old position.

    - You found some algorithm already to find out if a wall is on a line between 2 points? (We cannot help as long as we do not know your data. If you have a gamefield of 20x20 fields: Are walls just lines between 2 fields or is a field filled with a wall? Dependend on that you could think about the algorithm. And maybe you need some mathematics knowledge, too.)

    - Maybe you need some more information about handling the mouse. Maybe the Form events are not enough (I don't think so, but I didn't do full tests so far). On www.codeproject.com are a lot of articles regarding that. I just did a search on "mouse c#" there and got a long list of interesting articles. But at the moment I would think that the standard events should be good enough already so that no tricks are required.
    http://www.codeproject.com/KB/cs/Auto_Clicker_Bar.aspx (includes mouse movement / positioning)
    http://www.codeproject.com/KB/library/InputManager.aspx (a complete library for handling user inputs.)
    http://www.codeproject.com/KB/DLL/WindowsHookLib.aspx (Description of window hooks - you should have understood code you are using from others else you have a point of failure in your program where you cannot debug!)

    At the moment I cannot think of more points that I can generally describe (or find some desription on the net for you). In general I would say that MSDN Library and CodeProject are two great locations to search on some topics. (I would suggest to also try to search yourself more. It is just a litte practice and then you will be able to find solutions to a lot of problems on your own!)

    And of course: You are welcome in the foums here. We are willing to help you. But please provide some code parts where you have problems. Or at least more details what your program is doing and what is going wrong. Maybe you can upload the full project as a ZIP somewhere and provide us a download link. (I don't have much experience with that but there are sites like rapidshare.com. Not sure if they still provide free uploads/downloads....)

    With kind regards,

    Konrad

    • Marked as answer by Cookie Luo Thursday, August 4, 2011 6:03 AM
    Sunday, July 31, 2011 8:02 AM