Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Just looking at your code - what did you expect to happen? Haven't got VS installed here so I can't step through it and it looks a bit convaluted to follow through by hand. It should display a message box saying "TestBox :p" - is that happening? In the line SubClass.DoWhatever() did you mean newClass.DoWhatever()
  2. Really not sure if this syntax is correct but try something like Panel *box[] = new *box[no_boxes]; you may have to experiment with that as I am on dodgy ground with my C++ here ;)
  3. You may be better of parameterising the query or using a stored proc rather than converting the dates to strings and then doing string comparisons on them.
  4. How long does the web service take to return? You may find that it is firing the timer, calling the WS and then the timer is firing again before the WS returns.
  5. C++ isn't my strong point (never mind managed C++) but I think the problem is Panel *box[]; as you are declaring the array but not sizing it. You will need to allocate an array big enough to hold no_boxes number of elements.
  6. Could you attach the file in question, I will check to see if it works here.
  7. Strange, is there nothing above the lines begining with Option (e.g. no other import statements or namespace declarations?)
  8. Did you change all the pieces of your code to match my suggestions? If so are you getting the same error in the same place or something new? If possible could you repost the code including those changes? Also as I suggestion I would recommend renaming your files / classes to reflect the purpose rather than leaving them at Class1 - will make the code a lot more maintainable in the long run. I would also recomend putting the following 2 lines at the very top of your source files Option Explicit On Option Strict On and fixing any errors that are now raised.
  9. http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88913.aspx might be worth a read as it covers this area. Also note that you didn't need the and on the calls in Main
  10. You can always use the DateTime class itself to find out the number of days in a month clicky and given a particular date what day of the week it is another clicky Probably far easier than trying to loop over the rendered calendar control.
  11. You could use an array of labels and loop through them or alternatively loop through the Form's Controls collection and compare the control name to the string.
  12. Not had chance to have a proper look - haven't got VS installed on this machine yet. However I think the problem lies with how you are creating / instantiating your variables. For example in your form you have the following code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a As String Dim newappl As New application.Class1 newappl = New application.Class1 newappl.AppUser(TextBox1.Text) 'newappl.AppPassword(TextBox2.Text) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim newappl As New application.Class1 newappl = New application.Class1 newappl.Start() End Sub You are declaring an instance of application.Class1 and calling .Start on it in the form_load but declaring a seperate instance in the button click event. You may find the following is closer to what you need Dim newappl As application.Class1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a As String newappl.AppUser(TextBox1.Text) 'newappl.AppPassword(TextBox2.Text) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load newappl = New application.Class1 newappl.Start() End Sub You are also doing a similar thing in application.Class1 try the following instead to see if it helps Public Class Class1 Dim newdata1 As datalayer.Class1 Public Function AppUser(ByVal test1 As String) Dim a As Integer a = newdata.Search(test1) If a <> -1 Then MsgBox("Yes") End If 'newdata.AddStadd(test1, test2) 'Return newdata.Final(test1, test2) End Function 'Public Function AppPassword(ByVal test2 As String) ' 'newdata.AddStadd(test1, test2) ' 'Return newdata.Final(test1, test2) 'End Function Public Sub Start() newdata1 = New datalayer.Class1 newdata1.filldatasetandview() End Sub End Class Also code like Dim newdata As New datalayer.Class1 newdata = New datalayer.Class1 is redundant as the first line declares a new instance of the class and then the second line declares another new instance. Hopefully I should have VS installed by tomorrow and can have a better look (notepad isn't the best editor around ;)) - so if there are any other problems jusr reply here.
  13. If you step through the code in the debugger does it assign a value to mydv before you use it? If so is it being reset anywhere?. Failing that could you attach the whole code file to see if that helps.
  14. Looks like you haven't assigned an instance of the DataView to mydv. I can see that the filldatasetandview function creates an instance - is this function being called before the Search routine?
  15. Within your delpoyment project look under the list of dependencies, right click on the wmp.dll and there should be a menu option to exclude it. The error simply means this file is part of windows and if you attempt to install a different version from what windows is expecting it will put the original one back. If people need your version of the dll then they would need to install the correct version of Media Player.
  16. Which line raises the error? Also when it crashes check if any of your variables are currently null.
  17. When you look at the figures whats 16K when you have 1/2 Gig of RAM going spare ;)
  18. When you compile the application it will generate the code for it - this does not have a direct 1-1 size comparison with the raw source code.
  19. .Net handles memory through a process called Garbage Collection. The GC is lazy by design and will not attempt to reclaim memory if there isn't a need, and it tunes this to the system it is running on. How much RAM is in the system you are running your app on?
  20. At runtime T could be any class at all, and as such may not have the + operator defined - hence you cannot reliably use the + operator here.
  21. Is this being called from an ASP.Net application? If so what you will find is that ASP.Net will maintain the connections after they are closed so it can recycle them for use with other web sessions. If you re-execute the function from within the web page do you notice any new connections being made?
  22. Setting a variable to nothing doesn't free up the resources straight away under .Net, it just indicates to the Garbage Collector that they are now elligable for collection. You should call either the connection's Close or Dispose methods of the connection to release the DB connection.
  23. These may be worth a look http://www.xtremedotnettalk.com/showthread.php?t=86674&highlight=IActiveDesktop http://www.xtremedotnettalk.com/showthread.php?t=86675&highlight=IActiveDesktop
  24. Is this returning any errors at all as it looks like it should work
  25. You probably need to change the longs to integers with .Net and IIRC you also need to set the final parameter to SPIF_SENDCHANGE. Try the following - it should work. Declare Function SystemParametersInfo Lib "User32" Alias "SystemParametersInfoA" (ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Long Private Const SPI_SETDESKWALLPAPER As Integer = 20 Private Const SPIF_SENDCHANGE As Integer = &H2 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "C:\windows\Coffee Bean.bmp", SPIF_SENDCHANGE) End Sub
×
×
  • Create New...