class containing an object instance

Posted on 2004-12-01
Last Modified: 2010-04-24
Hai All,

I don't know why when I try to debug and print a value of the object instance of the class, it gives an hex number, instead of Integer value. Let me show you my code to better understand the problem I am facing. I have a serializable class

<Serializable()> _
   Public Class conventionPayment
        'Other fields
     Private regisYear As Integer
        Public Sub New()

        End Sub
        ' Do shallow cloning
        Function ShallowClone() As conventionPayment
            Return CType(Me.MemberwiseClone(), conventionPayment)
        End Function

         Function DeepClone() As conventionPayment
            Dim m As New MemoryStream
            Dim b As New BinaryFormatter
            b.Serialize(m, Me)
            m.Position = 0
            Return b.Deserialize(m)
        End Function

       Public Property regYear() As Integer
                Return regisYear
            End Get
            Set(ByVal Value As Integer)
                regisYear = Value
            End Set
        End Property
'other properties
End class
And... I have another class that contains an object of the above class

 Public Class cancellationClass
      'other field here

        Private cancelledConvReg As New PaymentUtils.conventionPayment

        Public Property cancelledConventionReg() As PaymentUtils.conventionPayment
                Return cancelledConvReg
            End Get
            Set(ByVal Value As PaymentUtils.conventionPayment)
                'cancelledConvReg = Value.DeepClone                  
                cancelledConvReg.transID = Value.transID           'Line#K
            End Set
        End Property
     'other properties
End class

Actual object assignment:

Dim cancelledObj As PaymentUtils.cancellationClass
 cancelledObj = New PaymentUtils.cancellationClass
 cancelledObj.cancelledConventionReg = objConv   'this objCon is an object of conventionPayment.  
                   ' I don't see any problem with this object  and this objCon is assigned with correct values.

When I try to DEBUG at line#k (see above), Value.regYear displays '&H7D4' which is hex number equivalent of 2004.

Why is that? regYear is integer and I want to assign integer (in decimal system) value to it . Am I missing something?.....

Question by:karthikeyanTP
    LVL 2

    Author Comment

    I figured it and solved myself. Accidently, QuickWatch Value is set to Hexadecimal value. I turned it off now. Ovvv....:)

    I am going to close this question.

    Accepted Solution

    Question answered by asker or dialog valuable.
    Closed, 50 points refunded.
    ee_ai_construct (replacement part #xm34)
    Community Support Admin

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now