From: "Bill McCarthy" TPASoft.com Are Identity on

"Schmidt" <sss(a)online.de> wrote in message
news:eFOTmaddJHA.3708(a)TK2MSFTNGP06.phx.gbl...
>
>
>> >> VB.NET has optional params as well ;)
>> > In the meantime, yes - that's a nice feature - and
>> > also the Variant-Type is back again as it seems.
>>
>> No it's not. I assume your talking about type inference -
>> this is NOTHING like Variant. And it can be turned off.
> Not exactly like a real Variant, yes ...
> http://www.igloocoder.com/archive/2007/03/17/1028.aspx
>
> - too sad, that you cannot change such a type at runtime
> (this is more a PreCompiler-thingy) - you would have
> to use .NETs generic Object-Type for scenarios where
> this is needed.
>

Okay so you were talking about inferred typing. That's just a "lazy" typing
option where you don't have to explicitly specify the type where the type
can be inferred. Where it is crucial is when you have anonymous types and
hence can't specify the type name.

As to "variant" style behavior, in .NET, everything derives from Object. So
it is an inheritance based model of variance. Variant on the other hand is
simply a container with the type information and the data/ or pointer to the
data. Very simple to write that, but it serves no purpose in .NET as you
can specify As Object everywhere you would use a Variant (with the
exceptions of code that digs into the actual variant structure such as my
VB6 safe array pointer manipulation class).

From: Tom Shelton on
On 2009-01-14, Bill McCarthy <TPASoft.com> wrote:
> Hi Tom,
>
> "Tom Shelton" <tom_shelton(a)comcastXXXXXXX.net> wrote in message
> news:%23Tbc22ddJHA.3488(a)TK2MSFTNGP05.phx.gbl...
>>
>> Declare Auto Function GetWindowText Lib "user32" ( _
>> ByVal hWnd As IntPtr, _
>> ByVal lpString As StringBuilder, _
>> ByVal nMaxCount As Integer) As Integer
>>
>
> You can use ByVal lpString As String in VB.NEt and it will do safe copying
> (unicode or ansi based on platform). Just don't try that in C# withotu the
> addition of the VBByRefStr attrbiute.
>

I am aware of that, but I always perfere StringBuilder when receiving string
values. Habbit I guess.

--
Tom Shelton
From: "Bill McCarthy" TPASoft.com Are Identity on

"Tom Shelton" <tom_shelton(a)comcastXXXXXXX.net> wrote in message
news:OG6vTledJHA.5648(a)TK2MSFTNGP02.phx.gbl...
> On 2009-01-14, Bill McCarthy <TPASoft.com> wrote:
>> Hi Tom,
>>
>> "Tom Shelton" <tom_shelton(a)comcastXXXXXXX.net> wrote in message
>> news:%23Tbc22ddJHA.3488(a)TK2MSFTNGP05.phx.gbl...
>>>
>>> Declare Auto Function GetWindowText Lib "user32" ( _
>>> ByVal hWnd As IntPtr, _
>>> ByVal lpString As StringBuilder, _
>>> ByVal nMaxCount As Integer) As Integer
>>>
>>
>> You can use ByVal lpString As String in VB.NEt and it will do safe
>> copying
>> (unicode or ansi based on platform). Just don't try that in C# withotu
>> the
>> addition of the VBByRefStr attrbiute.
>>
>
> I am aware of that, but I always perfere StringBuilder when receiving
> string
> values. Habbit I guess.
>

yeh, but from a VB6 perspective the declaration is basically the same,
except now you can use Unicode as well. the only thing I change for VB6 API
is handles to IntPtr to make them 64/32 bit safe, and I change Integer and
Long to Int16 and Int32 just so as there is no confusion. In fact a lot of
the time I use the Vb6 api viewer tool if it is handy.

From: Karl E. Peterson on
Schmidt wrote:
> I do this all the time - e.g. in my multithreaded working
> AppServer-Implementation in dhRichClient.dll.
> Working with shared memory is not a hack - that's the
> way it works (on top of the automated TLS-marshaling -
> in case one want's to use that too in his VB6-Threads).
> [etc, etc, etc.]

Y'know, if I didn't know better, I'd say Matt Curland moved to Germany and assumed
another identity! (Perhaps as part of the federal witness protection program or
something? <g>)
--
..NET: It's About Trust!
http://vfred.mvps.org


From: Ulrich Korndoerfer on
Hi Olaf,

Schmidt schrieb:

> Yep, one can use either McKinneys Typelib - or some
> newer pendants to it, which are available after a short Google-
> session.

And the Google search phrase would be ?

--
Ulrich Korndoerfer

VB tips, helpers, solutions -> http://www.proSource.de/Downloads/