Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. I know in C# you can use string.Empty (or String.Empty). The fastest method will always be to check the length, VolteFace's last comment. If txtInput.Text.Length = 0 Then Strings are objects in .NET and contain a header which contains, among other things, the length. It's faster to compare that a known number than to check for "" (or even string.Empty). -Nerseus
  2. I don't believe there's any built-in support for showing the animation part of an animated gif. You can load an animated gif as a single image but to use the other images as an animation will require parsing the gif yourself or using a 3rd party control. Or, you could use the WebBrowser control :p -Nerseus
  3. I mean open in the VisualStudio IDE, not programmatically. That was just to get them out of the DLL and into a file of your own. I'm not sure how to get them out of a DLL at runtime... -Nerseus
  4. I don't think you'd want to change the cursor for those buttons anyway. As long as they look disabled, that should alert the user that they can't be selected. -Nerseus
  5. Some objects you MUST call Dispose on yourself, to free memory. Things like DeviceContexts come to mind though I haven't used them in .NET. I know Graphics objects that you create must be disposed (not the ones passed in as an argument to a Paint event). I suspect that the Graphics object is creating a DeviceContext behind the scenes. If you don't call Dispose it doesn't get released til the Garbage Collector runs (and maybe not even then). There are other things to be aware of when using Dispose, especially if you create your own object. Read through the help on it to get more info. -n
  6. What context? What's the code you're running (and the other code that initiates it)? -Nerseus
  7. In .NET, you can use File-Open on the DLLs and EXE of Outlook Express (or any other EXE or DLL for that matter). .NET will show you the resources, including Icons and Bitmaps. The one you probably want for Outlook Express is msoeres.dll, in the Program Files\Outlook Express folder. I don't know about copyrights on these images, but I would assume you'd need MS's permission. -Nerseus
  8. To put them in the container if they're already on the form: 1. Click on the radio button in the designer to give it focus 2. Cut them from the designer (Ctrl-X) 3. Click on the GroupBox to make sure it has focus 4. Paste the cut controls into the GroupBox Alternatively, if you "draw" the radio buttons in the GroupBox when you first put them on the form, they'll be contained automatically. -Nerseus
  9. I found this when searching Google for "KeyCodeV2": http://support.crystaldecisions.com/library/kbase/articles/c2011205.asp Looks like a fix :) -Nerseus
  10. You can put it in a function or using DataBinding. But otherwise, there's no "magic" to a particular field and a control. For a function, use something like: void PutVal(object a, TextBox t) { if(a==System.DBNull.Value) t.Text = string.empty; else t.Text = a.ToString(); } // call it with: PutVal(dataSet.Tables["Table1"].Rows[0]["Column1"], textBox1); PutVal(dataSet.Tables["Table1"].Rows[0]["Column2"], textBox2); PutVal(dataSet.Tables["Table1"].Rows[0]["Column3"], textBox3); PutVal(dataSet.Tables["Table1"].Rows[0]["Column4"], textBox4); // The following is the same as above, but more readable DataRow row = dataSet.Tables["Table1"].Rows[0]; PutVal(row["Column1"], textBox1); PutVal(row["Column2"], textBox2); PutVal(row["Column3"], textBox3); PutVal(row["Column4"], textBox4); -Nerseus
  11. Set the Form's AcceptButton property to a button control on the form. This won't work when some controls have focus, such as a multi-line TextBox. But then, you wouldn't want Enter to press a button in that case :) -Nerseus
  12. Put the groups of radio buttons (2 and 4) in a container, such as a GroupBox or Panel (GroupBox is preferred, usually, if you want a border and title). -Nerseus
  13. It's a project type, not an outside utility like VB6. Use the "New Project" option from the start page. -Nerseus
  14. I use ICQ Lite. If you mean Lite vs. the full version, I can't really say. I heard there's another program that interfaces will ALL instant messengers, but I don't know anything about it or event its name. And don't limit yourself to what I suggested for your "pick a number game". Enhance it yourself, that's half the fun! Maybe add a GUI to it (textboxes and such) instead of console or more. Who knows? -Nerseus
  15. I was thinking you'd create two versions of CreateRandomNumber, one like this: int CreateRandomNumber() { // returns a random number // used as in: // int x = CreateRandomNumber(); } the second version would look like: void CreateRandomNumber(int) { // sets the passed in variable to a random number // used as in: // int x = 0; // CreateRandomNumber(x); // x is now assigned a random value } The tricky part of the second functions lies in passing in x so that it can be modified. The try/catch allows trying a statement and catching any exceptions that it throws. Your example doesn't actually throw an exception, so a try/catch won't work - you'll have to do an if(..) to test if what they enter is a number. But it would be good to learn about try/catch anyhoo :) My MSN is I was thinking you'd create two versions of CreateRandomNumber, one like this: int CreateRandomNumber() { // returns a random number // used as in: // int x = CreateRandomNumber(); } the second version would look like: void CreateRandomNumber(int) { // sets the passed in variable to a random number // used as in: // int x = 0; // CreateRandomNumber(x); // x is now assigned a random value } The tricky part of the second functions lies in passing in x so that it can be modified. The try/catch allows trying a statement and catching any exceptions that it throws. Your example doesn't actually throw an exception, so a try/catch won't work - you'll have to do an if(..) to test if what they enter is a number. But it would be good to learn about try/catch anyhoo :) My MSN nerseus_mcsd though I can't connect right now. I have ICQ and Yahoo if you have them. As for posting the source, don't worry about it. The point is for you to understand what's going on and feel confident enough to move forward :) -Nerseus
  16. Just check the string in a try/catch for now - nothing super fancy. It would check if you can use try/catch. You could also try to test isnumeric - a good idea to check if you don't know how :) All my "pagers" are in my profile (see the button at the bottom of each post). I think it's nerseus_mcsd, but I can't remember offhand. -Nerseus edit: I'm no C++ guru, to be sure. I know C# pretty well and VB6 like the back of my hand. I can answer basic questions on C++ if you need them but you might be better posting in the Language Specific C++ forum if you have general-purpose C++ questions. For DirectX, check out the Graphics forum - it needs more posts anyway :)
  17. lol, I love "type in something and press Enter to Quit" :) I found a a few problems, but whether you want to change them or not is up to you. On a larger project you'll want to make sure you *thoroughly* test each piece of code before moving on. For instance, you can enter letters instead of numbers and cause an infinite error loop. Also, your attempts variable is off by one (it says 0 attempts after my first guess). But not too bad overall - I'd really get rid of the goto if you can (and you can). I'd also suggest trying to break some of the code into functions. For instance, create a function CreateRandomNumber() that returns a new random number. Once that works, try CreateRandomNumber(number) that takes a parameter of type int and sets its value. Similar to a ByRef argument in VB. Just to make sure you understand the basics of pointers in C++. After all that, see if you can create a simple "player" class to contain the number of guesses, last guess, etc. to help you understand the usage of classes, instantiating them, etc. Obviously all this is overkill for such a simple game - but it will help you get down the basics of the language so that you won't have to pause in the middle of learning DirectX (or any other add-on technology for that matter) simply to figure out the basic. And most importantly, Have fun!! -Nerseus
  18. I think you need something like: using namespace std; or just: using std; (I forget) :) Also, only some of the books on informit.com are free (24 I think). Look in the Free Library section, it doesn't have a direct link from the main page but here's how to get to it: 1. From the home page, click on the "+" sign next to Programming on the left. 2. On the next page, on the bottom right under "In the Free Library" click on "More Programming Free Library Books". 3. At the top of the page next to "Browse the Free Library" you'll see: Home > Free Library > Programming. Just click on Free Library and bookmark that page! :) I'd give you my link, but it has my sessionID which won't do you any good. :) -Nerseus
  19. Does the current value contain a null? This might fail on a ToString (can't remember offhand). If it's not null, try casting it as DateTime and then do a ToString, as in: txtDOB.text = ((DateTime)myDataReader.Item ("DOB")).To string("d"); -Nerseus
  20. lol - well, you can get free books online as well. Head over to informit.com to get a few books free (online) for C++ v.6, VB6, and even C#! Good Luck! -Nerseus
  21. Is the DOB column a DateTime and non-null (System.DBNull.Value)? -Nerseus
  22. Are you binding the TextBox or manually putting in the value? If you're doing it manually, you can use the .ToString method of the column in your DataSet. If you're binding, you'll have to hook into the DataSet's bind and parse events. Check the help files for info on these two events and how to hook them up so they convert data to/from one type to another. -Nerseus
  23. Are you binding the textbox, or manually taking the value as a string from the TextBox and moving it back into the DataSet or other object? -Nerseus
  24. It depends on what you want to do in DirectX, really. I'd hope you'd know the standard structures (if, while, switch, etc.), how to declare and use variables, etc. That's a pre-requisite to be sure. After that, it really depends on what you want. If you have a good DirectX book, it will come with source code ready to go. If not, you're in a heap of trouble - you'll have to figure out how to add include directories, header files, and more just to get something started. I'd recommend a book with a CD of source code :) Once you get a sample or two working, you'll really want to know a LOT more about C++ before you'll want to know about DirectX. Most books try to encapsulate DirectX into custom "wrappers", which the Author will show you. Unfortunately, if you don't know C++ very well, classes will be mostly confusing if you haven't used them before in another language. The bottom line is that you'll want to know C++ well enough to write a simple, non-DirectX app before you begin writting a DirectX app. Give yourself a little task and see if you can write a program to do. I did the following when I first started programming on my friend's Vic-20: 1. Generate a random number between 1 and 100. 2. Ask the user to enter a number between 1 and 100 3. Tell them "higher", "lower" or "You got it" Once you get it working, see if you can move some of the code into functions, to see how to pass parameters back and forth. The point is to try and learn some of the basic of C++. After that, pick up a DirectX book and start learning! :) -nerseus
  25. Yes and yes. The forum is microsoft.public.win32.programmer.directx.managed. I connect using Outlook Express. Go to Tools-Accounts then press the Add->News button. The server name is msnews.microsoft.com. After I installed the DirectX 8 SDK my Digital Camcorder started having problems when burning movies from tape and back to tape after I'd modified them. I get the same problems now that DirectX 9 is installed. They're mostly DEBUG ASSERT messages generated from direct show (filtergraph messages) that I can click "No" on (to not go to debugging), but it interrupts my movies waaaay too often and never in the same place or at a particular point in time. I never got a workaround while using Pinnacle Studio. I started using Microsoft's Movie Maker to rip the movies to my hard drive which doesn't seem to generate the MessageBox's. But when I still had problems burning back to tape, I just moved my firewire card to another machine and everything works fine. I've seen some messages on the MS newsgroup related to video, but mostly with performance issues - nothing that I saw about other problems like mine. Let me know if you ever figure out how to get around the errors :) -Nerseus
×
×
  • Create New...