Implicit conversion useable in other languages

  • Thread starter Thread starter Kel Good
  • Start date Start date
K

Kel Good

Hello,

I recently created a structure in C# that offers several implicit
conversion, hoping I could then reference the C# project from a VB.Net
project, and use this object in VB.Net. It does not seem to work.

I know you cannot create implict conversion in VB.Net, but is the feature
also only useable from C#?

Thanks.

Kel
 
Kel,
I know you cannot create implict conversion in VB.NET, but is the feature
also only useable from C#?
The current version of VB.NET does not support Operator Overloading, which
means creating or using them. Using them as operators that is.

However! You can use the underlying functions created as part of the
Operator Overloading. Which means from VB.NET you can use the op_Implicit &
op_Explicit methods of your C# class to get at the overloaded operator
methods.

You may need to use 'Tools - Options - Text Editor - Basic - General' to
change the "Hide advanced members" to see the op_Implicit & op_Explicit
function.

Note: when creating overloaded operators a static function starting with op_
is created, VB.NET can use the op_ functions created.

BTW: VB.NET 2004 (Whidbey) is suppose to support Operator Overloading!

http://msdn.microsoft.com/vstudio/productinfo/roadmap.aspx

Hope this helps
Jay
 
Back
Top