Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You will also need to check / uncheck the item yourself. Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click MenuItem3.Checked = Not MenuItem3.Checked If MenuItem3.Checked = False Then Me.TopMost = False Else MenuItem3.Checked = True Me.TopMost = True End If End Sub
  2. Do you now get more detailed error messages though?
  3. You still have the authentication mode set to Windows though
  4. Rather than a structure could you not use an array of Players?
  5. The file you posted doesn't have set like the FAQ says and you also still have set which the FAQ also says should be taken out.
  6. You will need to specify the image src as a URL rather than a file system path.
  7. It would call ParentClass(), ChildClass(), GrandChildClass(int) if you wanted it to use the ParentClass(int) c'tor then you could change the code to: public class ParentClass { public ParentClass() { } public ParentClass(int k) { } } public class ChildClass : ParentClass { public ChildClass() { } public ChildClass(int i) : base(i) {} } public class GrandChildClass : ChildClass { public GrandChildClass() { } public GrandChildClass(int i) : base(i) { } } and tell the overloaded c'tor to call the correct one from the base class.
  8. Have you looked at the CompareValidator control - may do the job, if not try a customervalidator
  9. Given the following classes public class ParentClass { public ParentClass() { } } public class ChildClass : ParentClass { public ChildClass() { } } public class GrandChildClass : ChildClass { public GrandChildClass() { } public GrandChildClass(int i) { } } the line GrandChildClass c1 = new GrandChildClass(); will call the constructor of ParentClass() then ChildClass() then GrandChildClass(). if you instantiated it like GrandChildClass c1 = new GrandChildClass(1); then it would call the constructor of ParentClass() then ChildClass() then GrandChildClass(int).
  10. Firstly ignore what I said earlier - CollectionBase isn't abstract. However I did remember something and I've had time to dig something up. Firstly This Link explains a bit and may solve your original problem as well ;) If that made sense then Here's the MSDN description and another Little tutorial
  11. Is it in the same folder as the executable? If you are using visual studio the .exe is found in a sub folder of the solution (Debug\bin or Release\bin).
  12. http://www.xtremedotnettalk.com/showthread.php?s=&threadid=82337 as done by our very own dynamic_sysop. Be nice and thank him ;)
  13. If it is in the standard search path then just the assembly name + extension should do, otherwise you will need the path and name.
  14. You will need to provide the full path to the assembly - including the .dll extension.
  15. Ignore this - I was wrong :)
  16. Try System.DateTime.Today instead of DateTime.Now - could be due to the time portion not being equal.
  17. in the web service Public Function Test(ByVal i As Integer) As DataSet If i = 1 Then Dim ds As New DataSet 'do whatever with dataset here Return ds Else Throw New ApplicationException("Some error or other occured") Return Nothing End If End Function in the client you can handle the error like Dim x As New localhost.Service1 Dim ds As DataSet Try ds = x.Test(1) 'should return data ds = x.Test(2) Catch ex As System.Web.Services.Protocols.SoapException 'error occured MessageBox.Show(ex.Message) End Try have a look Here for a bit more info on SoapException
  18. You could throw an exception, this would be received at the client as a SoapException if I remember correctly
  19. At the top of the file add Imports System.Data Imports System.Data.SqlClient
  20. A normal class needds to go through the instantiation process every time it's used and contains instance specific information. i.e. public class MyClass private FirstName as string private LastName as string public sub SetFirstName(x as string) FirstName = x End sub public sub SetLastName(x as string) LastName = x End sub public function GetName as string return FirstName & " " & LastName end function 'etc. end class 'example of using it 'causes instantiation etc dim x as new MyClass 'multiple calls often used when dealing with class x.SetFirstName("Blah") x.SetLastName("Smith") Label1.Text = x.GetName() 'class memory released sometime later which is fine if a class needs to remember information between calls and behave in a stateful way. (Often the case in a windows app, or if the object is being stored in a Session for example) if you simply want to make a module like function call and avoid the state management etc. then something like the following would work. public class MyClass 'note no private vars etc. 'shared function public Shared function FullName (fName as string, lName as string) as string return fName & " " & lName end function end class 'usage Label1.Text = MyClass.FullName ("Blah","Smith") 'never instantiated etc. each however have their own strengths and weaknesses - but they can be combined in a single class. This is used a lot throughout the .Net framework (Math.Sqrt - Math is the class, MessageBox.Show - MessageBox is the class)
  21. Set the treeview's contect menu to be the ContextMenu rather than setting the form's context menu.
  22. Doing it with shared members would give you both the speed of using a module as well as maintaining OO principles - feel free to go out of your way to not use OO though.
  23. Could you show a bit more code before the line ecode = olDmAllocBuffer(WinFlags, buffersize, hbuf) i.e. how are you initalizing WinFlags, buffersize and hbuf (which looks like it should point to some kind of buffer and may be the one that needs initializing)
  24. Creating class instances each time you need to use this function will incur overheads (creating, memory and sooner or later garbage collection), but will be more re-usable. Have you considered a class with a Shared (or static if using C#) method - behaves more like a VB module but is still following OO principles.
  25. Problem seems to be the bit Do BytesReceived = MyFTPSocket.Receive(ReceiveBuffer, 512, SocketFlags.Peek) ReponseServerString += Encoding.ASCII.GetString(ReceiveBuffer, 0, BytesReceived) Loop Until BytesReceived = 0 I'm geting a result of "425 Can't open data connection" - however it can take ages to return this response. It will go into a dead loop here as you are only peeking at the response and not removing it from the buffer. Will see if I can find anything that could work here.
×
×
  • Create New...