Error Message

  • Thread starter Thread starter IntraRELY
  • Start date Start date
I

IntraRELY

Hello,

I am recieving an error message, that is from a 3rd Party component
(www.webcabcomponents.com/dotNET/dotnet/bonds/index.shtml), but wanted to
get your imput if it is my problem. I am trying here becuase I need it fixed
now and their support takes at a minimun 1 day. Thanks.

"Reference to a Non-Shared member requires an object reference." -- I dont
know what that means

I get a blue line indicating an error under the word "YieldToMaturity"

Here is my VB.NET Code
Imports WebCab.Libraries.Finance.Bonds.TreasuryPrice
--------------------------------------------------------------------

Dim buyYield As Double = YieldToMaturity(sellPrincipal, sellPrice,
lastCouponDate, tradeDate, settlementDate, paymentDates, maturityDate,
couponAmounts, "NEW_YORK", basis)

I have I Added a Reference in Visual Studio.NET w/in the project to the
WebCab.Libraries.BondsDemo.dll file. I know I am passing the correct data
types to the method. VS.NET is picking up the intellisense, so it should be
referencing it.

Here is the help file syntax:

'YieldToMaturity(
' double principleSum,
' double marketPrice,
' DateTime previousCouponDate,
' DateTime evaluationDate,
' DateTime settlementDate,
' DateTime[] paymentDates,
' DateTime maturityDate,
' double[] couponPayments,
' BusinessCalendar businessCalendar,
' string dayCountConvention
')

TIA,

Steve
 
Tia,

I have a vague idea that it is the second but last parameter causing the
trouble. It's expecting a business calender, you gave it a string. Try
....,New BusinessCalenda(...whatever the parameters are),...) instead.
Maybe the last to parameters are accidentally interchanged?

Klaus
 
I meant "Steve", of course (still sleeping, how embarrassing...)

Ciao

I ment...Klaus

;-)

Klaus Löffelmann said:
Tia,

I have a vague idea that it is the second but last parameter causing the
trouble. It's expecting a business calender, you gave it a string. Try
...,New BusinessCalenda(...whatever the parameters are),...) instead.
Maybe the last to parameters are accidentally interchanged?

Klaus


IntraRELY said:
Hello,

I am recieving an error message, that is from a 3rd Party component
(www.webcabcomponents.com/dotNET/dotnet/bonds/index.shtml), but wanted to
get your imput if it is my problem. I am trying here becuase I need it fixed
now and their support takes at a minimun 1 day. Thanks.

"Reference to a Non-Shared member requires an object reference." -- I dont
know what that means

I get a blue line indicating an error under the word "YieldToMaturity"

Here is my VB.NET Code
Imports WebCab.Libraries.Finance.Bonds.TreasuryPrice
--------------------------------------------------------------------

Dim buyYield As Double = YieldToMaturity(sellPrincipal, sellPrice,
lastCouponDate, tradeDate, settlementDate, paymentDates, maturityDate,
couponAmounts, "NEW_YORK", basis)

I have I Added a Reference in Visual Studio.NET w/in the project to the
WebCab.Libraries.BondsDemo.dll file. I know I am passing the correct data
types to the method. VS.NET is picking up the intellisense, so it should be
referencing it.

Here is the help file syntax:

'YieldToMaturity(
' double principleSum,
' double marketPrice,
' DateTime previousCouponDate,
' DateTime evaluationDate,
' DateTime settlementDate,
' DateTime[] paymentDates,
' DateTime maturityDate,
' double[] couponPayments,
' BusinessCalendar businessCalendar,
' string dayCountConvention
')

TIA,

Steve
 
I am recieving an error message, that is from a 3rd Party component
(www.webcabcomponents.com/dotNET/dotnet/bonds/index.shtml), but wanted to
get your imput if it is my problem. I am trying here becuase I need it fixed
now and their support takes at a minimun 1 day. Thanks.

"Reference to a Non-Shared member requires an object reference." -- I dont
know what that means

The normal meaning for this error is that you are trying to call a method
(in this case the YieldToMaturity method) that is not a shared method. You
need to create an instance of the class that has this method. I don't know
about the components you are using, but did you properly Dim the object so
that you can call its instance methods? Just a thought. Also, it seems
that you are passing a string ("NEW_YORK") when the method expects a
BusinessCalendar.

Just a few thoughts.
 
Hi,

From the MSDN,

Visual Basic Reference Error Messages
Reference to a non-shared member requires an object referenceSee Also
Reference Matching
You have referenced a non-shared member within your code and failed to
supply an object reference. You cannot use the class name itself to qualify
a member that is not shared. The instance must first be declared as an
object variable and then referenced by the variable name.
To correct this error
Declare the instance as an object variable.
Reference the instance by the variable name.
See Also
Reference Matching


As Klaus and Chris said, you may try to check the ' BusinessCalendar
businessCalendar paramter, while you are passing a string.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top