Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. Without seeing your code, I can only guess. It appears that you've chosen the TransformedColored vertex type instead of TransformedColoredTextured. It looks like your sample is from DirectX4B if I'm not mistaken...? The vertex type you've chosen are being lit by Direct3D. Assuming you have no lights or maybe an ambient one, it's distorting your "black" triangles. I'm guessing you want the TransformedColoredTextured vertex type. This is used for "sprites" where you want to specify the X and Y coordinates in screen space. Direct3D won't apply any lighting to those triangles so you'll get what the vertex color is (Black in your case) or any combination of vertex colors and textures, if you're adding textures. -nerseus
  2. Assuming everything fits on the screen (no scrolling) you'll have NO trouble using GDI for your drawing. With the typical game of "life", you're just drawing a bunch of tiles. As long as you don't try making each tile a PictureBox control you'll be fine. :) -nerseus
  3. Normally, you won't be using GDI and DirectX at the same time. You may use some GDI functions to read in image file formats that DirectX doesn't support, but as far as actual drawing to the screen you'll most likely use one or the other. What kind of program did you have in mind? Do you just want cool effects, or were you writing a game? DirectDraw doesn't support alpha blending (translucency) but does support color keys (transparent regions). Direct3D support pretty much everything, but the learning curve is steeper. If you want DirectX and normal window controls to intermix (such as a textbox), you might have problems. With GDI+ you probably won't have any issues. -Nerseus
  4. I don't know the legalities of using the icons from other programs, but you can open most EXE or DLL files in Visual Studio (using File-Open) and see a list of their resources. For instance, opening SHELL32.DLL (found in your windows\system32 folder) gives a list of AVIs, bitmaps, cursors, icons and more. You can right click any of them and choose export (make sure to change the extension to the right one). Again, I don't know if they're redistributable - I did a search on Google but couldn't find anything which doesn't mean you *can* use them. If you find some you like, you may want to write to MS (or post on one of their official forums) to ask. -Nerseus
  5. You must bind your grid to a DataSet or something that supports IBindingList and maybe another interface or two. You definitely do not need a database to use a DataSet. You can load one a number of ways - completely manually if you wanted to. If you have valid XML you can load a DataSet using the ReadXml() method. If you use XmlReadMode.InferSchema it will build a schema for you... -Nerseus
  6. I have WinXP and Win2000 but neither use WinZip - I use the built-in compresser of WinXP but it doesn't understand CAB files for some reason (or at least mine wasn't opening it). Couldn't find extract at that location for XP. I know it's out there, just never remember where it is. Thanks for helping out, Volte :) -Nerseus
  7. All I see is a CAB file. I'm too lazy to figure out how to use Windows to extract it. Can you put a zip up there? -ner
  8. Ack! Don't mess with the default form's Dispose method unless you need to (and you don't need to) :) Can you upload your project for us to see? It seems like it should be working. -Nerseus
  9. Forgot to mention I updated your state.xsl as well. It was using the Description for the state name. I also converted the Option element to be built using XSL so that I could set the Value attribute (or the StateID as mentioned above) to values from the XML. -Nerseus
  10. I've attached a version the populates the city combo "by hand". I think the code's a little easier to read, plus I can't remember off-hand how to pass params to XSL using javascript :) (you'll need a param to filter the cities per state). Sorry about the reformatting of the HTML file. I prefer the script at the top and I don't like using SCRIPT FOR... - just my preference and it was easier for me as I was debugging: your City XML was invalid, no closing tags on the <City> nodes. When filling the State combo, it's interesting to note that you can create your own attributes and pull out values as if they were part of the DOM. For example, change: <xsl:attribute name="value"><xsl:value-of select="StateID"/></xsl:attribute> to <xsl:attribute name="StateID"><xsl:value-of select="StateID"/></xsl:attribute> You'll create an option tag that looks like: <option StateID="1">Nevada</option> Now you can reference the StateID with code like: var stateID = States.options[states.selectedIndex].StateID; Notice that the last piece of this line, StateID, is an attribute of the option element. Pretty cool, as you aren't limited to storing one value per option tag. Only works in IE of course, but then again so do the XML islands :) If you decide to go with using a transform to fill the City list, you'll have to define a param in the XSL and fill it from the javascript. Or, you can cheat - which is how I've done it in the past - and use the XSL island as XML (which it is) and perform a selectSingleNode to find your template match and change it dynamically based on the current stateID. Have fun! -Nerseus city.zip
  11. If you want Form3 to clear out of memory then you must change: //form3: private void YES_Click(object sender, System.EventArgs e) { YES.Enabled=false; Form1 frm1 = new Form1(); frm1.Show(); this.Dispose(); } You would want to use this.Close() if you planned on reopening Form3 again later. Dispose will wipe it out of memory. -Nerseus edited: forgot you were opening Form3 first :)
  12. You may want to read up on Application.Run. Since you're passing the Run method a form, the application exits when that form closes. There are a couple of other options - check out the help file to get a full list. Normally, you would only have one "main" form that Application.Run will run. It might be an MDI form or it might be an SDI application that creates other forms, such as splash screens, toolbar windows, etc. In these scenarios, you'll use Application.Run(new FormX()). If you want to have independant forms, you can. Just create a form and .Show() it, then call Application.Run() with no parameter. You MUST call Application.Exit() at some point to shut down the application though. Closing the last form doesn't do this - you'll have to know when the last form is closing and call Application.Exit(). You can often do this in your last form's Closed event. Here's some code snippets: // In Form1: [sTAThread] static void Main() { Form1 f = new Form1(); f.Show(); // The following runs until Application.Exit() or Application.ExitThread() Application.Run(); } // In Form1's button1_click event: private void button1_Click(object sender, System.EventArgs e) { Form2 f = new Form2(); f.Show(); this.Close(); } // In Form2's Closed event: private void Form2_Closed(object sender, System.EventArgs e) { Application.Exit(); } If you're cutting and pasting this code, make sure you actually wire up the events, don't just paste in the functions :) -Nerseus
  13. If you can show a snippet of each XML island (states and city/states), I could post some XSL that would work. Or, I could show the looping code to build the options manually. Building manually is easier to read in code, but slightly slower. Probably not an issue since either method will run in less than 1/10 second. You're likely to wait longer for the browser to refresh than to do the actual filtering. -Nerseus
  14. Where do you plan on doing the filtering, client side or server side? If client side, I assume you're using IE with DataIslands, or something else? If you plan on doing client side filtering and you have Data islands (<xml id='xml1'>...</xml>) then you can use javascript. Trap the first combo's changing and call a function. You can use selectNodes with something like "/City[state= + " selectedValue + &quot]" (the exact syntax depends on your XML) You can then loop through XML nodes and create OPTION objects and add them to the City's combo. Or, if you don't want to loop but use binding, you'll need to store the XSL in an island so that you can transform the State/City XML and shove it back into the xml island that the city is bound to. It's a little nastier and requires more work, but will probably run a little faster. For server side you could do either option (create the <option> elements manually or transform the XML), but the transformation would be a little simpler and probably the better way to go, assuming you know XSL. I can't help with server-side code as I don't much about ASP.NET and where you'd put the transformation code (in Page_Load or something? I have no idea :)) -ner
  15. How about a Preview button on the bottom of a thread? As it is now, I always have to click the "Post Reply" link to enter what I want so that I can preview it before posting. Not sure how hard this is to add or if it's even possible but I'd like it :) -ner
  16. Are you trying to send a message to the COOL:Plex program or is it trying to send something to you? If you're trying to send it a message, use SendMessage. You'll need the window handle (hWnd) of the window. You can get it through the API FindWindow or a similar function. This MAY not work, depending on the windows that COOL:Plex creates. FindWindow finds top level windows and if the one you're sending a message to is farther down, you may have to loop and find it. Assuming COOL:Plex is designed to be interfaced to, they should have made it pretty simple. SendMessage also takes a message number, 42 in your case. The wParam and lParam can be 0 unless the COOL:Plex docs say to pass something else. -Nerseus
  17. I've seen a number of threads on this same topic in the Microsoft managed DirectX forums. I haven't used DirectDraw myself, but from what I can glean from the posts, Alpha Blending is not supported. There is support for color keys, to create transparent regions for sprites but that's about it. The following is a snippet of a thread with Patrice Scribe and Oleg: -Nerseus
  18. Have you seen this set of articles from Microsoft? I saw a piece talking about datatypes in Paradox and how they map in .NET. I didn't read too far but it might be useful. -Nerseus
  19. If you must read an INI file from a program that you're not writing, you will have to use the API. If you're writing an application, I wouldn't use an INI - use XML or the registry. I haven't seen any support for reading/writing INIs in the .NET framework whereas the API was made just for that purpose. It takes care of all the file parsing and is the recommended way to read/write an INI file. -Nerseus edit: P.S. It might be worth mentioning that most of the old windows INI files exist for backwards compatability. For instance, ODBCINST.INI, which contains ODBC drivers, is now in the registry. Pretty much everything you would want from win.ini or system.ini is in the registry. If you're looking for something specific from an INI file go ahead and ask - maybe there's a better way to get at it now than through an INI.
  20. About every 5th post is for a tile engine, I think. I'd sort by post count or replies. There are MANY posts with attachments for tile engines, some good, some... not so much. Most are for making editors - not a lot of real game making going on in the forums :) -nerseus
  21. Why would you want to use HTML controls in a windows app? Don't the Windows controls do what you need? Or, why not go pure web app if you're more familiar with that? I'm not sure I understand what you're doing and why would want the two to interface so closely, aside from "can it be done"... There was another post about hooking the events from a WebBrowser control. I think divil posted the way to cast the control's document property to a "real" .NET type. Using a similar technique, you might be able to trap an HTML button's click or a hyperlink that's navigating away and intercept to run some code on your form. Not sure why you'd want it to work that way - seems like a lot of work :) -nerseus
  22. I have no problem catching the exceptions. What code are you using to update your dataset? Here's a sample of something that breaks for me: try { ds.Tables["Folder"].Rows[0]["FolderTypeID"] = 99; } catch(InvalidConstraintException e) { Debug.WriteLine(e.Message); } In my table "Folder" the "FolderTypeID" of 99 isn't valid. I have a relationship to a parent table that only has FolderTypeID values from 1 to 10. -Nerseus
  23. /bows before the almighty divil :) -ner
  24. Yep - still the Resize event. You want the form's WindowState property, as in: private void Form1_Resize(object sender, System.EventArgs e) { if(this.WindowState==FormWindowState.Minimized) { // Do your custom minimize to tray Debug.WriteLine("min"); } } [edit]fixed code tags to use the [cs] [/cs] tags[/edit] -Nerseus
  25. Real code is code that runs as expected with no errors - the only kind the users care about - they don't care what language was used. Waxing nostalgic here... I loved VB3. It was fast, easy, did everything it needed to. It sucked for making installs - DLL hell was a pain, but the abundance of 3rd party controls was just fuuuun. Don't get me wrong, there's not enough money in the world to make me go back to touch any code I wrote 8 years ago in VB3, but I loved it :) -Nerseus
×
×
  • Create New...