Nerseus
*Experts*-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
You want to use Clear() if you're trying to remove the *rows* from the DataTable. If you want to clear them from database, you'll need to Delete() them and then call the DataTable (or DataSet's?) Update() method. Dispose is a .NET mechanism for cleaning up resources on objects. You'll pretty much never use it on a DataSet, DataTable, etc. -nerseus
-
Are you sure it's not something else dropping your frame rate and/or that you're calculating it correctly? Does your graphics card normally go faster than that? Depending on the implementation of the sprite class, you could also see a HUGE drop in performance if it's not optimized for tiling. For example, if each call to Sprite.Draw is setting the texture and calling device.Begin and device.End (BeginScene/EndScene I think) then you may be wasting a lot of cycles. For my Ms Pacman clone, I wrote a "SpriteList" class that takes a bunch of individual sprites and combines all their vertices or vertex buffers. Assuming your tiles all share the same texture, you really only need to call SetTexture and BeginScene one time then draw every sprite in one shot. A nicely packaged sprite engine isn't necessarily the fastest thing - it just makes drawing sprites easier. If you want, check out the VB Game forums. To misquote Banjo from another thread, writing a tile-based RPG in VB is a common affliction amoungst novice programmers. I hope you don't fall into that category :) -Nerseus
-
If you just want the compiled version of the 3DS conversion tool, it's included in the SDK extras. If it's not in the DX9 extras, try the DX8 extras at: http://www.microsoft.com/downloads/details.aspx?FamilyId=965D6C6D-5CE9-44C4-B1A7-EC938CF1CEBF&displaylang=en I think it's called conv3ds.exe. You can search google for hints and tips on using it to convert models as not all models are created equal :) -Nerseus
-
I haven't used Crystal since version 6 or 7 (I can't remember) but you used to be able to split sections as well. So if you're "cangrow" section is in the Details section, you can split it to "Details a" and "Details b" to accomodate things like cangrow fields with something coming after. If the "cangrow" field is an address, sometimes it's better to give it a fixed height big enough for, say, 4 lines. It's useful for things like letters where you may want the opening paragraph to be at an exact point. I'm sure you know what you want though - just spewing out old Crystal knowledge so I can make room for new memories :) -nerseus
-
You want to use 's' instead of seconds, as in: SELECT datediff('s', tmstamp, endtime) as elapsedtime,recindx from Chronology ORDER by recindx -nerseus
-
I use the architecture our architects suggest. I have a hand it the decision, but they make all the tough decisions. It's definitely n-tier as our projects are usually quite large, spanning a dozen servers or more. With that many servers involved (SQL Server, File Server, Web server, web services only servers, Application servers, etc.) it requires a lot more knowledge than I want to spend time learning. From my point of view, I reccommend where the web servers and application servers "live" in the architecture but that's about all. From that, I must deal with the other issues such as creating a development environment that we can use for developers, QA testers (2 levels), and demos. It's quite a bit to consider since you can't necessarily rely on "convential" means to read application settings, such as the registry. For example, if you have one development application server hosting multiple COM+ components (VB6) but you need to have them point to two different SQL Servers for two sets of developers, you can't really read the registry to get a connection string. Or, if you use trusted connections and set the component's identity then app server must be on the same domain as the SQL Server, which isn't always the case. Plus, our current architecture supports a customized version of MS's auto-download feature. We built our own version checking and dependency checker to auto-download assemblies as needed AND only if you have access (access being defined by Active Directory, which holds some application data and permissions). If you're a smaller company or an individual then it's best to use a simplified 3 tier architecture. For testing purposes, I'd suggest 4 servers, if possible: SQL Server, Application Server (COM+ components or .NET components) and 2 Web Servers if you are going to be hosting ASP or ASP.NET pages. Why two? You want some experience with NOT relying on the session since session information isn't shared between web servers so you'll have to come up with a custom solution, such as storing session information in SQL Server. If you're a larger company or developing a solution for one, it's good to have someone like Microsoft come in and reccommend the "proper" way to set up servers and development machines. You'd be surprised by how much you can learn from 2 or 3 official Microsoft staff helping you out for a week. Expensive, but well worth it :) -nerseus
-
You can test that IIF (at least in VB6) checked both cases by putting in a MsgBox in the True and False parts. Run the following and you'll see both message boxes: Dim Result As Long Result = IIf(True, MsgBox("True"), MsgBox("False")) It's a common VB6 "bug" that you should know about if you use IIF. It also makes it harder to comment what each case is. I have used the C++ style "IIF" in VB6. It only works if you need to return true/false, such as to set an Enabled property. Suppose you have a Recordset and you need to disable a save button if there are no records: cmdSave.Enabled = (rs.RecordCount = 0) It evaluates the expression on the right and returns true/false which is assigned to the Enabled property. Does anyone know if VB6 supports the C# syntax for the ( ? : ) evaluation? It's the equivalent for IIf but doesn't evaluate both sides and is strongly typed. You'd use it as: int i = 5; int j = (i < 10 ? 42 : 43); I use it on occasion where the true and false parts are simple. If they are more than 1/3 of my screen, I break it into if()...else... -Nerseus
-
I use only C# - read any of my posts and you'll see my apologies at attempting to use VB.NET. I've used VB professionally for about 8 years but liked C# better. Having to learn the assemblies and WinForms (or WebForms) is more than 90% of development - the language is just a means to get everything else working. My company basically took a vote and decided to go C#. Most of us knew JavaScript from our web programming so the syntax wasn't difficult. I like the "strictness" built into C# FAR more than VB's - I was never too keen on all the type coersion going on in VB6. 99% of the time it was convenient, but that 1%... oh, that 1% :) I almost asked the same question on the Language Specific forums - why are there SO many more posts for help with VB.NET than C#. Then I realized what it was: C# programmers are smarter and don't need help :p -Nerseus
-
Here are the shortcuts: Arrows: Moves control by grid unit Ctrl-Arrows: Moves control by 1 pixel Shift-Arrows: Resize control by grid unit Ctrl-Shift-Arrows: Resize control by grid unit Per form - actually, per control that allows nested controls such as panel - you can turn the grid on/off and change the size. You can't change the border... -nerseus
-
Ah, if it's a hyperlinke (anchor tag) that you want, simply set the "hover" style of the anchor tag in the stylesheet. Here's a sampe: <html> <style> A:link { COLOR: #FF0000; TEXT-DECORATION: none } A:visited { COLOR: #800000; TEXT-DECORATION: none } A:active { COLOR: #0000FF; TEXT-DECORATION: none } A:hover { COLOR: #FFFF00; TEXT-DECORATION: underline } </style> <body> <table width="100%"> <tr> <td onMouseover="this.style.backgroundColor='#CC3333';" onMouseout="this.style.backgroundColor='#FFFFFF'"> <div align="center"><a href="some.htm">hyperlink test</a></div> </td> </tr> </html> You can also set the alignment on the TD if that's all you're using the DIV for. -nerseus
-
Here's a thread that talks about your same problem. You may want to search the forums next time - this thread was only 10 posts down :) -Nerseus
-
Your best bet is to define oMenu at the form level instead of inside the cmdBox1_Click event. Then it's accessible anywhere on the form. From within cmdBox2_Click, you can first check if it's been set with something like: If Not (oMenu Is Nothing) Then ' Use oMenu End If At least, that's how you'd check it in VB6 - I think it's the same syntax :) -nerseus
-
Assuming the "1" in "this.1.style..." is the div, I'd use a name that starts with an alpha. Try replacing "1" with "a1" or something. You can also use onMouseover and onMouseout on the div tag to change the foreground color. You could either change the style or the class since your div is already using one. -ner
-
You'll have to use the textbox's Parse and Format events to convert the date into your mask's format. Look in the help for either of these events - they have sample on converting Currency to String and back (I think). Also, you may want to avoid the maskedit box as it's not a real .NET control. Check out divil's tutorial on how to use regular expressions to validate a control's text. -nerseus
-
Defining the layers is completely up to you, smartsid. You'll find articles on MSDN that talk about general strategy. Generally ASP.NET is the middle and sort-of the presentation tier. When using a browser, the presentation "tier" is really split into two parts. First there's the web server which sends data AND layout information to the client. Second there's the browser, which is ultimately the presentation layer since it will do all the displaying of information. You can also have ASP.NET spew out nothing but data. It acts more like COM+ used to - exposing objects and data - only it uses webservices over HTTP instead of DCOM. In that respect, ASP.NET is strictly middle tier. This assumes that you're using a database, which is your data tier. You can put the database on your web server but I wouldn't - very bad idea. Or maybe you don't have a database, but files or something else. You may not even have a data tier. As for your last question, yes you can pass datasets to the presentation layer assuming your presentation layer is NOT a browser (more likely to be WinForms). If your presentation layer IS a browser and you know it's IE, you can pass the DataSet's XML to the browser as an XML data island and use it that way. -nerseus
-
Try printing out the following: Console.WriteLine(exc.GetType().ToString()) If it spits out anything other than "Exception" then that's the type you'll want. If it spits out "Exception", you're stuck using something else. If it's a managed class causing the error, I would think there's a more specific error... but who knows. -nerseus
-
I believe XP was intended to run faster than previous OS's, including 2000. Win2000 wasn't meant for home users; it was a business platform that was meant to be easy to configure and more stable than any other OS. One of the main selling points for XP was stability, but more importantly it was speed. I can't count how many times I've read about the increased performance the average user will see with WinXP over WinMe, Win98, etc. WinNT and Win2000 are totally different operating systems. Win2000 is MUCH nicer to work on, more stable, faster, etc. etc. I can't speak for .NET server as it hasn't been release and you can't truly judge an OS until it is officially out and you've used it for awhile, but I don't believe it's "based" on .NET. It may have more "stuff" built-in to help .NET developers but generally that's only a benefit to professional developers. Meaning, the things the OS will make easier are generally geared towards system services, such as COM+, Message Queuing, etc. Obviously they will be .NET services, but still not things the average developer will be using or worrying about. Here's a thought: maybe we should split the second half of this thread to a new one under "Random Thoughts" :) -Nerseus
-
Or use the built in installer which could offer to download the framework direct from MS if it's not already installed... :) -nerseus
-
For future reference, you may have finer control of where textures (and vertex buffers, and more) go when using different pools, but for just starting with .NET I'd go with the Managed pool for pretty much everything. In the managed pool, you don't have to worry about freeing resources when the device is lost or reset. By using the Default pool you'll have to sync up the device's reset so that all of your resources are freed and re-created at that time. Also, I noticed that turning on the managed debugging added a TON of information whereas dbmon only spits out messages from DirectX. If you have a not-so-fast machine like me then it may be better to just use dbmon. Glad you got the problem worked out though :) -nerseus
-
If it's a school assignment shouldn't you be figuring this out on your own? :p -Nerseus
-
Have you read up on what Dispose is used for? If you're worried about being able to use an object once it's "disposed" then what you want is to set it to Nothing. Dispose is used when you need to free resources that must be freed immediately such as file handles, window handles, device contexts, etc. Are you having problems with a program not shutting down after the last form is closed or something similar? To me a "hook" is something specific - it's when you are hooking into a window message handler or something "advanced". Some clarification, please :) -Nerseus
-
You can use exc.GetType() to see what the real exception type is. It might just be Exception, but it might be some other type that you're not trapping for. Also, check if the InnerException property is null. If it's not, check what it's type is (using GetType()) as well. Some exceptions, if handled by managed code, may embed themselves as inner exceptions. You don't want to rely on the GetHashCode method. The help file states that it is only guaranteed to be unique per instance of a class (and per AppDomain and some other things). If the exception doesn't have a more specific type (such as some kind of TimeoutException) then you might have to use the Message property. But check the exception type is first and see if that works :) -ner
-
Sorry - this is in C#. I'm not sure of any good VB.NET resources. The objects and methods should be the same in both so it shouldn't be hard to convert - the basic idea will be the same. I'm not 100% sure this article will help but it is used to do generic screen captures so it may, at least, get you started: http://www.csharp-corner.com/code/2002/april/screencaptureutility.asp Good Luck! -Nerseus
-
If your question was "will a user have to re-download 20meg every year or so to get an updated runtime", the answer is unknown. I would guess there would be smaller service packs, hotfixes, etc. to cover the majority of "necessary" upgrades. When it comes to updating a system, there are generally two categories of users: those that upgrade everything and those that never upgrade. For those that never upgrade you only have to worry if you develop on the *newest* version that isn't compatible with an older version. For those that upgrade constantly, you only have to worry if the new framework breaks your code - a very unlikely scenario. I've never had an issue with the MS runtime causing problems because of an upgrade. The worst thing I've seen is a bunch of controls getting a white background instead of grey one because of an outdated DLL - still not the runtime. Now 3rd party DLLs on the other hand - well, don't get me started :) You might think of it this way - if there were issues with programs breaking because the runtime wasn't backwards compatible, there wouldn't be many people developing with it. That's good enough for me, especially since I don't want to write a compiler (I'll let MS do their job on that one). :) I'm not sure what you mean about native code... .NET doesn't compile to native code normally - it compiles to an intermediate language that the runtime compiles "just in time" as the program is loaded. As a developer you have the option of compiling the code into native code for better startup performance using the tool ngen.exe but you run the risk of decreasing performance later. The "compiler" optimizes for the machine it's run on and can't be recompiled later. This means future compilers, which might optimize better, can't be used later on. Also, if you "compile" on a machine different than the end-user's machine, your app may be optimized incorrectly. This could be especially true a few years from now as 64bit processors come out - not to mention a new OS. To help out with preventing "DLL Hell", MS has changed its strategy on deployment. You should check out the help file at: Visual Studio .NET -> .NET Framework -> Deploying Applications It contains a ton of information on what you need to worry about when deploying your app, including upgrades and how the framework finds the right DLL at runtime. They've put a lot of effort into helping us developers get the program running on every machine. It does still mean we have to know a *lot* about what's going on at runtime to figure out how to get our installations to work right *every* time. For the record, what kind of shareware program are you writing or thinking about writing? :) -Nerseus
-
First, do you know how to get a screenshot at all? Once you have one, it will be a regular bitmap and using GDI+ you can crop it to whatever size you want. I'll try and put something together tomorrow if you can't figure it out by then :) -nerseus