|
|
Passinga null value to a com+ variant from c# |
|
Author |
Message |
Mikey The Pikey
|
Posted: Common Language Runtime, Passinga null value to a com+ variant from c# |
Top |
I have a VB com object with the code below
Public Function GetValue(value As Long, _ value As Long, _ value As Long, _ value As Integer, _ inDate As Variant, _ value As Integer, _ value As String, _ value As Integer, _ value As Date, _ value As String, _ ByRef value As Variant, _ ByRef value As Variant) As Boolean On Error GoTo err_handler : : unrelated code : : If IsDate(inDate) Then : :Do something : End If
I
am calling this com+ object from a c# .net2.X platform to calculate a
return value. However I wish to have the IsDate(inDate) assertion fail,
however no matter what value i pass in from c# i cannot get the
IsDate() call to fail.
I have tried passing empty strings null dates etc. etc.
Please any thoughts on this are welcome
Mikey
.NET Development26
|
|
|
|
|
Greg Beech
|
Posted: Common Language Runtime, Passinga null value to a com+ variant from c# |
Top |
|
|
|
nobugz
|
Posted: Common Language Runtime, Passinga null value to a com+ variant from c# |
Top |
Not sure if I'm on the right track here: IsDate() is not an assertion, it will simply return False if you pass it an object that can't be converted to a date. Try using CDate() to generate an exception.
|
|
|
|
|
Mikey The Pikey
|
Posted: Common Language Runtime, Passinga null value to a com+ variant from c# |
Top |
That is what we want to happen when we pass a non-date vale to the variant however no matter what i pass, no matter what. It still enters that loop.
I'm looking into this missing value im unsure yet will it be of assistance.
|
|
|
|
|
|
|