Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. I'm not at a machine that has DX installed right now but I can help (hopefully)! Look in the folder DXSDK\bin\dxutils for a program called dbmon.exe (I may have dxutils and bin swapped in the actual path). Run this program before you run your DX9 app. It's a console app that picks up a bunch of messages from DX9 - some informational, but a lot of error information, too. It should be able to tell you what's wrong. Especially with textures, DX9 is very particular about the pool a texture is located in as well as the usages defined when you're creating or copying textures. Hopefully DBMon will tell you what's wrong (like you can't use the Default pool for textures loaded from bitmaps or something like that). Alternatively, if you really want a lot of info spewed out, turn on managed debugging (go to the Project Properties to turn this on). If you look in the Output window (ctrl-alt-o) you'll see the *real* DX9 errors get spit out, along with a ton of other information. If you still can't get it working by tomorrow, let us know. I'll try and create a test project here to see what I get. -ner
  2. If it's just the image I wonder if you've got hard-coded paths to the file, something like "c:\file.gif" or something? What is the code behind your button? What does it do (specific code snippet would be good)? -nerseus
  3. Assuming the file is getting updated and NOT held open (which might cause problems when your program opens it), you could do just as you suggested: read the file in once OR just get it's length (not quite sure how - FileLen() in VB6 though :)). On subsequent calls, seek to that position and begin reading til end of file. At least in theory this should work :) -ner
  4. There's also a microsoft newsgroup for managed DirectX. There have been some fairly advanced topics on there, but don't worry - they also answer "newbie" questions as you are getting started. If you're using VB.NET, you have the VB directx newsgroup as well. Most of the posts concern DX9 so you may be able to get info there as well :) -Nerseus
  5. Closer... try this: Dim da As New SqlDataAdapter ("Select * from [" & TableName & "] Where NameID LIKE '%" & KeyWord.Replace("'", "''") & "%'", MyConnString) I put brackets around the TableName in case it's a reserved word. I change "NameID = ..." to "NameID LIKE ..." so that your % search would work. I also wrapped the KeyWord with single quotes (SQL standard for strings) and replaced one single quote with two, in case KeyWord has a value like "O'Malley" which would generate a SQL error. Keep in mind that putting the % BEFORE the keyword will cause a tablescan - could be very VERY slow if the table is large. Otherwise it's just slow :) If you can, only use the % at the end which won't be nearly as bad. It's fairly standard to assume that you must type the *first* few letters when doing searches in applications. Doing "full text searches" aren't strange, but less common as they will cause the aforementioned slowness :) -Nerseus
  6. Fixed in VB.NET? You mean C# 2003, or were you being sarcastic in that is now *doesn't* work in VB.NET 2003? I've never had trouble using intellisense with "this". You're right about "using" not having intellisense, but only for the first word. Since you use "System" about 99% of the time, it's not such a big deal but it is kind of a pain :) You can also press Ctrl-Space to bring up a list of "using" references, but not many people know about it or want to use it :) -Nerseus
  7. I'm not sure how feasable this is, but try something like this: Add a new property to your form called MyTabControl that returns an instance of the private TabControl. In the get property, set the webbrowser control's Visible = true. Then in code, replace all of YOUR lines from tabControl1 to MyTabControl. By "your" lines I mean don't change the "windows designer generated code" - mostly everything in the InitializeComponent function. Untested, but something like this should work. -Nerseus
  8. I think it's the same in both, it's just that VB.NET isn't case-sensitive whereas C# is. It can be a pain if you don't know what's going on :) I use the Tab key to have intellisense auto-complete for me and it adjusts capitalization automatically. Another trick is to press Ctrl-Space to have the autocomplete either fill in the rest of your word, or bring up the intellisense drop-down so you can pick what you want (and press tab to have it fill it in). I got used to that in VB6 and it's worked wonders ever since. -nerseus
  9. Nerseus

    .net beginner

    I can't speak for online information (although I'm sure it's out there) but I will put in my two cents for books. If you really want to learn programming, find a book (or online source) that talks about programming first and Windows second. I know lots of VB books, especially VB.NET, go into details about drawing controls and using events - which is great. But, you'll really want a good foundation of variables, if...then, loops, etc. before you get too far. I know that's what you asked for but if you head off to a bookstore be careful not to buy a book that looks good at a glance but doesn't have much meat once you get home. Make sure you read through it awhile and that the "programming" parts aren't in an appendix (usually a bad sign) :) -ner
  10. From the help for ExitWindowsEx: If you're running this from a service you're probably not the interactive user (same as if you were to run this from a COM+ component with an Identity set) so the Shutdown may not work. Did you specify the following flags: EWX_FORCE, EWX_FORCEIFHUNG, etc.? There are some notes in the help when you may want to use these flags and you may need more than the two above. Other than the above, I have no idea. I've never tried rebooting programatically. It seems like you'd only want to force a reboot when the machine was hung, but then your program or service isn't likely to succeed in rebooting. If something else is wrong, like the website's not responding, you'd want to FIX instead of just rebooting. You could shell out to "iisreset" or something similar. If COM+ stops responding you could restart the services and optionally issue a "shutdown" command to each package. 99% of the time there will be something else wrong and you won't necessarily have to reboot. We have some development servers that have been up for over 180 days. One runs SQL Server another runs our development website. Granted, we have to issue "iisreset" a couple of times a week after someone locks it up, but rebooting is usually something you do when you don't know enough to fix what's really wrong, IMO. It's a good oportunity to learn more about what your programs are doing possibly :) -nerseus
  11. I belive in VB it's just a function that matches the event type. I'd drop on a design-time context menu, add a click event handler and then use that function's definition (sender as object, etc.) for yours. Sorry I can't help more... dern VB/C# differences :) -ner
  12. For my suggestion, you may to set each color to a new Color rather than change the RGB individually. Try something like: Color SHIRT_MASK = Color.FromArgb(200,100,200); Color SHIRT_COLOR = Color.FromArgb(10,100,20); foreach (Color color in pal.Entries) { if (color.Equals(SHIRT_MASK)) { color = SHIRT_COLOR; } } Since structs are value types, it will make a copy of your SHIRT_COLOR and put it in the "color" variable. You can try Bucky's suggestion, too. I've no idea which is better as I don't really do much with palette-based images :) -ner
  13. /me whistles quietly to see if anyone is using J#... -Me
  14. I believe you want to use AddHandler to "hook" a click event to each menu. I'm not familiar with VB but I'm sure someone has some code they could post if this didn't help :) -nerseus
  15. First, I wouldn't run the EXE from the network (as Robby suggested). You can make a rudimentary install that gets it local. Next, if you determine that running local still takes a long time to load up, you can possibly run ngen on some of the DLLs and/or the exe (maybe?) to compile them to "native" .NET code - this will skip the runtime from JITing all your methods as they're loaded. MS has articles on using ngen to improve application startup performance, especially related to WinForms apps. For now, you could also add some testing code to your app to record timings. The idea is to see how long it takes from the first line in "Main" to your class's constructor to Form Load, etc. Display it in a message box or somesuch for now - just to see where the slowdown is. Maybe it's all in Windows and .NET and ngen will help or maybe it's someplace else. -Nerseus
  16. Can you define "lost"? Often times if you have some kind of scripting error, the page won't render all of your controls. You used to have to use View Source on the browser, scroll all the way down to see an error message. But maybe you mean something else? -Nerseus
  17. Another reason to use Stored Procs when possible - you don't have to worry about this (unless you're passing your parameters through a full-string, such as "exec procA 'param1', 123, 'param3'". Want to see something fun? Try this, set your variable reason to: "my reason') DROP TABLE TIMELOG --" If you look at the string you'll be building, you'll get: INTO TIMELOG ([uSERNAME],[LOGTIME],[REASON]) VALUES ('dan', '1:52PM', 'my reason') DROP TABLE TIMELOG -- ) This is NOT something you want a malicious user to be able to do. Watch your single quotes - could be more than just a syntax error :) -nerseuse
  18. You piqued my curiosity... and, true enough, when changing tab alingment in code only the WebBrowser seems to disappear. You can fix it by setting the Visible property to true after you change the tab's Alignment. Other controls, such as a checkbox, seemed to work just fine after the alignment switch. Go figure :) -nerseus
  19. I used the following (C#, sorry) and it worked. DateTime dt; SqlConnection conn = new SqlConnection("Integrated Security=True;Data Source=myserver;Initial Catalog=master;"); conn.Open(); SqlCommand cmdSql = new SqlCommand("select getdate() as [systemDate]", conn); SqlDataReader rdrSql; rdrSql = cmdSql.ExecuteReader(CommandBehavior.CloseConnection); rdrSql.Read(); dt = rdrSql.GetDateTime(0); Debug.WriteLine(dt); You can GREATLY simplify your proc, by the way. In fact, you don't even need a proc for what you want. Simply use this: Dim cmdSql As New SqlClient.SqlCommand("SELECT getdate() as [systemDate]") If you really want a proc, use: CREATE PROCEDURE procGetSystemDate AS SELECT getdate() as [systemDate] By using sp_executeSQL you're eliminating any benefit of using a proc, since you're running dynamic SQL that's hard-coded :) -ner
  20. I believe he said the Language Reference. Check out the keyword "Shared", "Static" etc. and read as much as you can - there is a GREAT deal of info around the class and member modifiers (such as public, private, shared, etc.). It's well worth the effort to spend 8 hours or so writing small sample classes and seeing what each keyword does and doesn't do. A book on VB.NET would cover this as well with good samples. -Nerseus
  21. You don't want to use an Adapter which is used to query data. You want a command object so you can issue your "CREATE TABLE" command. Here's a sample: OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\temp\\db1.mdb"); conn.Open(); OleDbCommand cmd = new OleDbCommand("CREATE TABLE tblTest (Col1 Number, Col2 Text)", conn); Debug.WriteLine(cmd.ExecuteNonQuery()); You can't create tables by using a DataSet, as you saw. The Update method will attempt to take any rows in your DataTables that are changed and update the corresponding table in your database. But the table you created was ONLY in the DataSet, not the Database so no update occurred. I don't know of any way to create an empty Access database through code. There may be a way, I just don't know :) -nerseus
  22. Is that a VB.NET feature? This isn't possible in C#, you'll get: Static member 'member' cannot be accessed with an instance reference; qualify it with a type name instead -Nerseus
  23. Since you didn't list VB as a previous language but you did mention C++, UNIX and Web Development (javascript on client?) I'd suggestion checking out C# since the syntax is closer to what you're used to or maybe J# (though C# seems to be MS's new front-line language). There are probably only slightly more resources on C# than VB.NET so finding help won't be a problem regardless of which language you choose. -ner
  24. I didn't mention this before, but my company doesn't host any applications or such on Crystal Tech (mentioned above) so I can't speak for volume-performance. I'm not saying they're bad, I just have no experience with them for that. All of my company's websites are hosted by the client or locally (for Dev and QA servers that don't need internet access - just intranets). If you're looking for a host for large web apps I couldn't suggest anything. My experience has been that a client that wants good performance in a web app is usually going to host the servers themselves or find a dedicated solution (some clients use one in Phoenix, AZ that hosts the servers with dedicated optical lines) rather than an out-of-the-box web hosting company. -Nerseus
  25. Wrox rocks. Check out Bookpool for the (generally) lowest prices and often times free shipping if you don't mind waiting a few extra days for media mail. (Not an issue if work is buying your books :)) -nerseus
×
×
  • Create New...