Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Confusing Code Execution

Confusing Code Execution

Scheduled Pinned Locked Moved Visual Basic
helpgraphicsquestion
8 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DeltaWind
    wrote on last edited by
    #1

    Public Class ControlStaffDemographics Inherits DevExpress.XtraEditors.XtraUserControl #Region " -- Member Class: ClassGroupListItem -- " Public Class ClassGroupListItem Public ReadOnly Group_PK As Guid Public ReadOnly GroupName As String Public Sub New(ByVal group As DataRow) Me.Group_PK = DirectCast(group.Item("Group_PK"), Guid) Me.GroupName = group.Item("GroupName").ToString End Sub 'New(ByVal group As DataRow) Public Overrides Function ToString() As String Return Me.GroupName End Function 'ToString() End Class 'ClassGroupListItem #End Region '-- Member Class: ClassGroupListItem -- Private Sub Save() Dim signatureStream As System.IO.Stream = New System.IO.MemoryStream() Me.picSignature.Image.Save(signatureStream, System.Drawing.Imaging.ImageFormat.Bmp) 'Other code removed End Sub 'Save() I have removed the excess code from this class for ease of reading. My problem: The second line in the Save method executes and jumps to the overridden ToString() function in the member class. There is no reference to the class or an instance of the class. Why would the execution jump to that point? Additionally, an exception is thrown when trying to execute the ToString method. Any help or ideas would be appreciated. :confused: David Zorn

    D D 2 Replies Last reply
    0
    • D DeltaWind

      Public Class ControlStaffDemographics Inherits DevExpress.XtraEditors.XtraUserControl #Region " -- Member Class: ClassGroupListItem -- " Public Class ClassGroupListItem Public ReadOnly Group_PK As Guid Public ReadOnly GroupName As String Public Sub New(ByVal group As DataRow) Me.Group_PK = DirectCast(group.Item("Group_PK"), Guid) Me.GroupName = group.Item("GroupName").ToString End Sub 'New(ByVal group As DataRow) Public Overrides Function ToString() As String Return Me.GroupName End Function 'ToString() End Class 'ClassGroupListItem #End Region '-- Member Class: ClassGroupListItem -- Private Sub Save() Dim signatureStream As System.IO.Stream = New System.IO.MemoryStream() Me.picSignature.Image.Save(signatureStream, System.Drawing.Imaging.ImageFormat.Bmp) 'Other code removed End Sub 'Save() I have removed the excess code from this class for ease of reading. My problem: The second line in the Save method executes and jumps to the overridden ToString() function in the member class. There is no reference to the class or an instance of the class. Why would the execution jump to that point? Additionally, an exception is thrown when trying to execute the ToString method. Any help or ideas would be appreciated. :confused: David Zorn

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I've never seen anything like that. I'd try closing Visual Studio, then reopen your project, recompile it in Debug mode to regenerate the symbols database, then try it again.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      D 1 Reply Last reply
      0
      • D Dave Kreskowiak

        I've never seen anything like that. I'd try closing Visual Studio, then reopen your project, recompile it in Debug mode to regenerate the symbols database, then try it again.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        D Offline
        D Offline
        DeltaWind
        wrote on last edited by
        #3

        Sounds good, but the same problem occurs on co-worker's computer as well.

        D 1 Reply Last reply
        0
        • D DeltaWind

          Sounds good, but the same problem occurs on co-worker's computer as well.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Is your code multi-threaded at all?

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          D 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Is your code multi-threaded at all?

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            D Offline
            D Offline
            DeltaWind
            wrote on last edited by
            #5

            No multithreading

            D 1 Reply Last reply
            0
            • D DeltaWind

              No multithreading

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              What is a picSignature object? I'm guessing that it's a simple PictureBox, but I don't want to assume anything...

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007

              D 1 Reply Last reply
              0
              • D DeltaWind

                Public Class ControlStaffDemographics Inherits DevExpress.XtraEditors.XtraUserControl #Region " -- Member Class: ClassGroupListItem -- " Public Class ClassGroupListItem Public ReadOnly Group_PK As Guid Public ReadOnly GroupName As String Public Sub New(ByVal group As DataRow) Me.Group_PK = DirectCast(group.Item("Group_PK"), Guid) Me.GroupName = group.Item("GroupName").ToString End Sub 'New(ByVal group As DataRow) Public Overrides Function ToString() As String Return Me.GroupName End Function 'ToString() End Class 'ClassGroupListItem #End Region '-- Member Class: ClassGroupListItem -- Private Sub Save() Dim signatureStream As System.IO.Stream = New System.IO.MemoryStream() Me.picSignature.Image.Save(signatureStream, System.Drawing.Imaging.ImageFormat.Bmp) 'Other code removed End Sub 'Save() I have removed the excess code from this class for ease of reading. My problem: The second line in the Save method executes and jumps to the overridden ToString() function in the member class. There is no reference to the class or an instance of the class. Why would the execution jump to that point? Additionally, an exception is thrown when trying to execute the ToString method. Any help or ideas would be appreciated. :confused: David Zorn

                D Offline
                D Offline
                DeltaWind
                wrote on last edited by
                #7

                OK. I found a solution of sorts. For some reason the code execution jumps to the ToString method and then to a high level Try...Catch. I placed a local Try...Catch around the 'offending' code and catch a meaningful exception at that point. I still don't know why the code jumped to the ToString function, but at least I can now debug the actual problem. In further insights would be appreciated, but for now I can move forward. Thanks for the help.

                1 Reply Last reply
                0
                • D Dave Kreskowiak

                  What is a picSignature object? I'm guessing that it's a simple PictureBox, but I don't want to assume anything...

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007

                  D Offline
                  D Offline
                  DeltaWind
                  wrote on last edited by
                  #8

                  It is a PictureBox

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups