Re: [ADVANCED-DOTNET] VB's ByVal/ByRef vs. C#'s ref/out

2002-11-18 Thread Richard Birkby
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

Re: [ADVANCED-DOTNET] VB's ByVal/ByRef vs. C#'s ref/out

2002-11-18 Thread Jason Masterman
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

Re: [ADVANCED-DOTNET] VB's ByVal/ByRef vs. C#'s ref/out

2002-11-18 Thread Steven Lyons
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'

Re: [ADVANCED-DOTNET] VB's ByVal/ByRef vs. C#'s ref/out

2002-11-18 Thread Mattias Sjögren
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

Re: [ADVANCED-DOTNET] VB's ByVal/ByRef vs. C#'s ref/out

2002-11-18 Thread Craig Andera
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

Re: [ADVANCED-DOTNET] Tearing my hair out - I am thoroughly disgu sted with VS.NET

2002-11-18 Thread Philip Nelson
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

[ADVANCED-DOTNET] VB's ByVal/ByRef vs. C#'s ref/out

2002-11-18 Thread Shawn A. Van Ness
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

Re: [ADVANCED-DOTNET] Marshaling an interop COMTI datastructure fails

2002-11-18 Thread Joseph Fourness
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