CyberJay82

Members
  • Content count

    98
  • Joined

  • Last visited

Community Reputation

229 Neutral

About CyberJay82

  • Rank
    Member
  1. Passing Parameters - General Question

    In C#, you don't really have pointers (You kinda due, but that is outside the scope of this thread). You could do this is a number of way but one is as follows: [CODE] Enemy myEnemy = new Wolf(player); StartBattle(player, myEemy); [/CODE]
  2. Regex Puzzle.. :(

    I used something similar to help strip html links out of a document and just replace the whole html tag with just the href part. Example: <a href="http://www.gamedev.net">Click Here</a> I would strip out the [url="http://www.gamedev.net"]http://www.gamedev.net[/url] part and the new text would just become [url="http://www.gamedev.net"]http://www.gamedev.net[/url] Here is the code I used for that: [code] foreach (Match match in Regex.Matches(sampleTextToParse, "<a href='(.*)'>(.*)</a>", RegexOptions.IgnoreCase)) if (match.Groups.Count > 1) sampleTextToParse = sampleTextToParse.Replace(match.Groups[0].Value, match.Groups[1].Value); [/code] I hope this helps you get what you need.
  3. That is the normal way unless the Custom Control is in the same solution as the project you are trying to use it in (which will auto-populate into the toolbox) . I usually just create a new tab in the toolbox and just add it via the Choose items dialog.
  4. [C#] Problems with SytemWindows.Forms.Design

    No, I mean add a reference through right clicking on your Reference folder in your solution tree and click add reference and select System.Design
  5. [C#] Problems with SytemWindows.Forms.Design

    Add a reference to the assembly System.Design in your project. That will fix it.
  6. [C#] Problems with SytemWindows.Forms.Design

    I'm sorry I meant I fired it up in Visual Studios 2008, but I will try to just copy those files into a new project and see where I get.
  7. [C#] Problems with SytemWindows.Forms.Design

    I downloaded the code and fired it up into Visual Studios 2009 and let it upgrade the solution and was able to build and run the project without making any changes what so ever.
  8. I made the following changes: Changed dr.ItemArray[] to just dr[]. class Program { static void Main(string[] args) { DataTable dt = new DataTable(); dt.Columns.Add("zero"); dt.Columns.Add("one"); dt.Columns.Add("two"); dt.Columns.Add("three"); DataRow dr = dt.NewRow(); dr[0] = 0; dr[1] = 1.0; dr[2] = '2'; dr[3] = "Three"; dt.Rows.Add(dr); }
  9. Why are you using row.ItemArray[0] instead of just row[0] ?
  10. [.net] Unable to import DLL

    I did a search after posting that answer and it seems that some people are saying as long as the PATH variable is setup right the system should find the dll. I'm not entirely certain, as I do more handheld stuff and putting dlls into the GAC on the devices. But I don't see why they would break the ability to use the PATH variable for dlls with .NET but who knows. I'll keep searching around for ya, but I would just triple check the PATH variable is setup correctly, not to be an jerk or anything to you. If I find anything I'll post again.
  11. [.net] Unable to import DLL

    I believe it has to be in the system32 folder on windows or in your application's folder. I usually use my application's folder so I don't interfere with other versions.
  12. C# - referencing release vs. debug assemblies

    Are Project A and Project B in the same solution? If so you can add a project reference. If not, one way you might be able to do is create a folder that would hold either the debug or release version. In your project settings for the Project A, have it copy the debug version or release version into the folder you created (named them the same so they just override each other). Then just have project A reference the dll that is in the created folder and since it will copy the debug or release version prior to building Project A it should build and reference the correct version, granted their were no build errors with project B or copy errors from project A's settings. So Project A would reference into a folder named Common which would have 1 dll in it called projectB.dll which is built either for debug or release based on being copied from Project's A project settings from porject B's output folders (debug or release). Hope I made things clear if not I can try and explain more if needed.
  13. [.net] C# TreeView and Custom Data

    You can use the Tag property of the Node to store custom data. You could do something along the lines of this: public class CustomNodeData { int iQuestID = -1; int iItemID = -1; public CustomNodeData(int questID, int itemID) { iQuestID = questID; iItemID = itemID; } } make the node with the custom data TreeNode tNode = new TreeNode(); tNode.Tag = new CustomNodeData(-1, 999); Then use the that custom data somewhere else public void SomeEvent() { TreeNode tNode = treeView1.SelectedNode; CustomNodeData cnData = (CustomNodeData)tNode.Tag; }
  14. Java glitch

    File F = new File("test.txt"); If java is anything like c/c++/c# then I am guessing because it can't find the file you are looking for. This is because based on that it will look for that file in the current directory, whatever that may be. You probably need to do some code to find out your app location and use that in front of "test.txt" or change the current directory to your application path. See if that helps at all. That is my guess is that it just is not finding the file based on the path provided. But I don't use Java so I could be wrong.
  15. class Graphics { GraphicsDeviceManager m_DeviceManager; GraphicsDevice m_Device; Game m_Game; public Graphics(Game game) { m_Game = game; m_DeviceManager = new GraphicsDeviceManager(m_Game); } } In your Application class instead of new'ing the Graphics class inside the class, move it to the Initialize function like so: protected override void Initialize() { // TODO: Add your initialization logic here m_Graphics = new GraphicsClass(this); m_Graphics.InitalizeGraphics(); base.Initialize(); }