Jump to content
Xtreme .Net Talk

CaNaDiAn BaCoN

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by CaNaDiAn BaCoN

  1. I'm working on my RPG Engine, ArrowRPG (I posted about it a while ago, here is the thread). I'm having trouble getting DirectInput to load devices. It gives me an ArgumentException saying that "Value does not fall within the expected range". Here is my code 'Importing: Microsoft.DirectX.DirectInput, Microsoft.DirectX, System.Threading, System.Collections.Specialized Public Sub New(ByVal actionMapPath As String) Dim dlDevices As DeviceList afActionFormat = New ActionFormat() 'Note: Protected Member of the Class that this constructs afActionFormat.ActionMap = Starter.Game.AboutData.Title 'This provides the title of the ArrowRPG Game afActionFormat.ActionMapGuid = Starter.Game.ID 'This provides the GUID of the ArrowRPG Game afActionFormat.AxisMin = -99 afActionFormat.AxisMax = 99 afActionFormat.BufferSize = 16 Dim asStates As ActionStateCollection = XMLActionMapLoader.Load(Starter.Game.Paths.Settings + "\actions.amx", afActionFormat.Actions) 'This loads an XML File to create an ActionMap (Note: Collection is filled properly) Try 'Exception occurs on line below dlDevices = Manager.GetDevices(afActionFormat, EnumDevicesBySemanticsFlags.Valid) Dim instance As SemanticsInstance For Each instance In dlDevices SetupDevice(instance.Device, asStates) Next Catch iex As InputException Throw New InvalidFileException("Unable to initialize Input Devices, invalid ActionMap", iex) End Try thInput = New Thread(AddressOf InputLoop) thInput.IsBackground = True thInput.Name = "Input Thread" thInput.Start() End Sub I've been working off of the "ActionBasic" sample from the DX9SDK, and I've almost copied the ActionFormat creation code, but it still doesn't work (Note: ActionBasic runs fine). What am I doing wrong? I realize that this is a DirectX Graphics Thread, but I couldn't find anywhere better to put this
  2. Yes, sort of... If you are trying to upload a file, you can use: <input type=file> I know how to retrieve the file in PHP but not ASP.net. It should be easy
  3. It is simple...I think I think this will work: <asp:textbox>Hello World</asp:textbox>
  4. This works, but... This expression should provide the result you want, if you're allowed to use it DateTime.IsLeapYear(CInt(year))
  5. Use DirectoryInfo System (or System32) is always a direct sub-folder of Windows (or Win2k/NT or whatever) so use the following code: VB: Public Function GetWinDir() as String 'Create a directory info structure of C:\Win2k\System32 or C:\Windows\system, etc. Dim di as New DirectoryInfo(Environment.SystemDirectory) 'Return the full path of its parent Return di.Parent.FullName End Function C#: public String GetWinDir() { //Create a directory info structure of C:\Win2k\System32 or C:\Windows\system, etc. DirectoryInfo di = new DirectoryInfo(Environment.SystemDirectory) // Return the full path of its parent return di.Parent.FullName } No matter the Windows version this should return the windows dir
  6. That may take a long time I tried that on an old app, and I took forever to load the TreeView at runtime. You need to consider that people may have HUGE directory structures. I think you can do it faster by working with the Windows Shell but I am not sure
  7. listviewname EDIT: Just rechecked your code, and the problem is not the string! You are passing listview to FillList BYVAL and not BYREF so when you compare it to lvwProjectsActive they are NOT the same. Change ByVal to ByRef in FillList and you should have no problem I agree, Strong Typing is ESSENTIAL! Now, here is my question: Is listviewname a String containing the name of the listview, or an actual listview object (This is impossible to tell, without seing code that calls OpenSelected because you have not used strong typing) If listview name is a ListView object, there should be no problems, you are having some other issue If listview name is a String containg the name, the problem is obvious. You are trying to compare the String "lvwProjectsActive" (for example) with the object itself! You must change your Select Case so that instead of saying: Case lvwProjectsActive you should say: Case "lvwProjectsActive" or Case lvwProjectsActive.Name Judging by the name, I think listviewname is the latter, but PLEASE give types to your variables! For example: ByVal listviewname as String
  8. Accessing Forms from Modules Unlike VB 3-6 forms are not static (or "Shared") objects, meaning you have to create an instance first! I agree with Heiko, but there are some cases where modules are the best option so the easiest way to fix your problem (assuming the form is called MyForm) is 1. Add this code to your module Module myModule Public theForm as New MyForm 'Add this line 2. Create a Sub Main inside your module and put the following code inside it Public Sub Main() theForm.Show() End Sub 3. Now change your projects properties so that the startup object is "Sub Main" 4. You should be able to reference controls on that form through theForm, from ANY module (Although you may have to type myModule.theForm)
  9. Why do u need to use an interface If you are just trying to confirm user input why not use properties? For example: protected String psEmail; public String EMail { get { return psEmail; } set { // Do some validation here psEmail = value; } }
  10. Thanks Thanks for the support
  11. I would like to announce to everyone that myself, and some friends, have started a project to create a .Net based RPG Engine called ArrowRPG. The Engine is for creating 2D games, and will use DirectX for drawing. Please check out the ArrowRPG Website @ http://orionrpg.sourceforge.net (Note: The project was originally called ORION RPG Engine, but the name has changed). You can also visit our SourceForge.net Project Page @ http://sourceforge.net/projects/orionrpg. Please visit and post your feedback on our fourms. I would be very grateful if everyone who reads this could reply with some feedback on either the website, or the source code that is posted (through CVS) on the website (Check the downloads section) Thank you very much CaNaDiAn BaCoN! - Founder: ArrowRPG P.S. I do not intend this as advertisement, but as a request for feedback. If the post appears as advertisment I apologise, but I just want to know what people think. There is NO PRODUCT at this time, just some preliminary source code
×
×
  • Create New...