Try the following. You will see that C# actually passes the out param value
into the function! As has been said, this is because it is a C# feature, not
a CLR/CLS feature.
--- VB.Net ---
Imports System.Runtime.InteropServices
Public Class TestServer
' Fool C# into thinking this is an out on
Here is an example - There is also a book call "C# & VB.NET Conversion
Pocket Reference", by Jose Mojica that covers these issues in detail
VB library-
imports System.Runtime.InteropServices
public Class VBLibrary
public Sub OutParm( ByRef x as integer)
x = 20
VB.Net doesn't include an "out" equivilent in the language but
supposedly you can use the attribute to write methods with "out"
parameters.
Sub OutDemo( ByRef num As Integer)
Calling methods should work the same way. I haven't tried it but this is
the way I hear it's done.
"out" parameters don'
Shawn,
Is there really no equivalent of C#'s "out" keyword, in VB.NET?
C#'s out is equivalent to useing a ByRef parameter in VB.NET, and tagging
it with the System.Runtime.InteropServices.OutAttribute.
Are methods with "out" parameters non-CLSCompliant?
No. But C# is the only language I kn
I don't know much about VB.NET, but I wouldn't be surprised if there's
no equivalent. It turns out that the underlying runtime doesn't actually
support out params. Both out and ref are implemented the same way: you
pass a pointer to a thing instead of the thing. It's just that using out
turns on so
Here is one point of view. The dll locking problem may be at times an
indication of too many classes in a single compilation unit. At 64K, this is
certainly *not* always true, but it has always been an annoyance to me that in
VS.Net, one project = one dll. It seems like a relatively simple optio
Is it just me or do these two pairs not match up very nicely?
Is there really no equivalent of C#'s "out" keyword, in VB.NET?
Are methods with "out" parameters non-CLSCompliant?
(I searched the archives, and found some early confusion from Ted Pattison and Don Box
on this matter, but no clear r
Michel,
Unfortunately, solving your problem will not be for the faint of heart!
The situation you are encountering is the typical problem with
attempting to pass a UDT through a Variant type. .NET Interop
(tlbimp.exe does not support all of the VT_* types) To make matters
even harder to debug, e