Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. MyClass anInstance = null; if (anInstance == null) { Console.WriteLine("The evaluation worked."); } As long as you assign something to it (even null) the compiler is happy.
  2. Could you not use a pattern similar to \w{2,} You will also need a required field validator to prevent blank entries being accepted
  3. Redirecting to a page that doesn't exist will not generate an exception - you just get a standard 404 error and the default error page. It may be easier to check the return value of sPath and if it equals "" then display the error message.
  4. You can still use ADO.Net to access non SQL databases, if you are using access then you will use classes under System.Data.OleDB - no need to use the ADODB as that involves all the COM interop and making sure all the ADO stuff is properly installed and registered.
  5. If you fail to explicitly close / dispose of the connection object then you have no control over when it will actually close, even though the page may only exist for less than one second any variables that require garbage collection may be around for a lot longer. If you fail to close DB connections yourself then these no longer needed but not yet garbage collected connections will still be in memory and still be holding on to a physical database connection.
  6. http://www.xtremedotnettalk.com/showthread.php?t=87237&highlight=process+explorer
  7. What is the value of p at this point - you may find you should be checking for if Not p is nothing
  8. Rather than using ADODB (which is the old COM way of doing things) you probably should consider ADO.Net (System.Data and related classes). Also you may want to give the database table an Identity (autonumber field) - this way every row will be assigned a unique value. You could obtain a count of words by doing a SELECT COUNT(*) from HangMan rather than looping through each record one by one.... Then instead of re-reading each record in a loop (for VarI = 1 to ChooseWord) just do a SELECT HangWord from HangMan where ID = Chooseword query. If you have more specific question when you start to implement this feel free to post again.
  9. you could just change the line that reads throw to something like MessageBox.Show ("Process not found") to stop it crashing out. However if you step through the code in the debugger which line is the one it fails on?
  10. Do the compound controls implement any special code for tab orders or handle the validating / gotfocus / lostfocus events?
  11. You will find nearly all the GUI elements are not thread safe, they are designed to be updated from the app's primary thread. If you wish to use them in a multi-threaded way you will need to look at using the control's .Invoke method.
  12. What version of VS / Framework are you using? Have you tried rebooting your system and running the app again? Are you declaring any Shared (static in C#) objects with shared constructors? If it's not too large you could post the code here and see if anybody can help
  13. If you compiled in debug mode you could possibly do this using some of the classes under System.Diagnostics but I imagine it could involve a lot of work. Possibly a better question is why do you need this?
  14. If you are requiring zip functionality for a .Net application then you may want to have a look at this site for a free zip library.
  15. You may want to read this thread for some more opinions. Personally I feel there are easier / cheaper (free) alternatives to VSS, check the links myself and Derek posted above and you may also want to look at http://subversion.tigris.org/ as another alternative
  16. If you are using delegates then you shouldn't need the FnPtr call. However this depends on how the DLL is constructed - what language was it written in and do you have any control over it's code?`
  17. Is there a reason this function can only be accessed by one user at a time - this kind of behaviour can make your life a lot more difficult. If you are restricting your web service to one user till they log out (the impression I got from your post) then you are going to have serious scalability issues with this scenario. It may be better to post what the application / web service are doing and see if anyone has a better suggestion for the application architecture.
  18. Have you configured the server to use SQL server + Windows authentication?
  19. Looks like you have IPv6 installed on both the client and server - hence the weird hex results.
  20. You were giving it a specific ip address to listen on - unfortunately the one you specified was 127.0.0.1! Normally this would only be required on a server with multiple ip addresses or multiple physical adapters and you only wanted it to listen on 1. My code just listens on all local addresses.
  21. the delegate definition needs to match with the function definition and vice-versa so in your case the delegate needs to be Delegate Function DLLPrntDelegate(ByRef fname As CBChar, ByVal x As Integer) Is the dll also VB6 / vb.net or is it written in another language? If in .Net you shouldn't require things like the FnPtr function to generate an integer pointer to the function. In all honesty the migration wizard is pretty useless and tends to generate code that doesn't actually compile and even if it does it rarely works correctly. If this is your first foray into VB.Net you will find the wizard generated code more confusing and useless than of any real benefit. You are probaby better of re-writing the code yourself.
  22. Most exceptions do not have (or even need an error code) because the type of the exception is the error. Rather than catch Exception catch the specific type you are after try 'something catch ex as DivideByZeroException 'handle catch ex as OverFlowException 'handle end try this gives far more readable code than the vb6 style of error 13 or 6 ,or 57 occurred (means nothing without documentation). It may help if you post the code within the try block - or at least give the exceptions error message.
  23. If you didn't use some form of source code control or take a backup then you are pretty much out of luck.
  24. Try changing Dim server As New System.Net.Sockets.TcpListener(localAddr, port) 'to Dim server As New System.Net.Sockets.TcpListener(IPAddress.Any, port) you are currently only listening on the 127.0.0.1 address rather than your real network address.
  25. could you post the code in question - including the bit where you try to add a delegate
×
×
  • Create New...