Home All Groups Group Topic Archive Search About

Upgrading arrays (VB6->VB.Net Express)

Author
13 Aug 2006 9:51 AM
Herbert Joll
Hello,

I want to upgrade my VB6 project to VB.Net Express.

I have a type, and I dim an array from it.

This is what I have.

    Private Structure TColorRGB
        Dim Red As Integer
        Dim Green As Integer
        Dim Blue As Integer
    End Structure

And what I do is:

    Dim NewRGBPoint(8) As TColorRGB

And now VB.Net is telling me that I it "couldn't resolve default
property of object NewRGBPoint(i) in these lines:

                             For i = 0 To 8
                                 'UPGRADE_WARNING: Couldn't resolve
default property of object NewRGBPoint(i). Click for more:
'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                                 NewRGBPoint(i) = LongToRGB(lColor(i))
                                 lTemp = lTemp +
GetBrightness(NewRGBPoint(i))
                             Next i

What I found in the MSDN what a bit of a joke or at least not
understandable: "Create an array!". Aha, I thought that was what I did...

Can anybody please help?
Thanks.
Herbert.

Author
13 Aug 2006 11:13 AM
Ken Tucker [MVP]
Hi,

       What the warning means that VB is expecting LongToRGB to return a
TColorRGB structure.

Here is some info on default properties
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vacondefaultproperties.asp

Ken
----------------------
Show quoteHide quote
"Herbert Joll" <DONTherbert.SPAMjoll@hotmail.com> wrote in message
news:Oxbn93rvGHA.3912@TK2MSFTNGP03.phx.gbl...
> Hello,
>
> I want to upgrade my VB6 project to VB.Net Express.
>
> I have a type, and I dim an array from it.
>
> This is what I have.
>
> Private Structure TColorRGB
> Dim Red As Integer
> Dim Green As Integer
> Dim Blue As Integer
> End Structure
>
> And what I do is:
>
> Dim NewRGBPoint(8) As TColorRGB
>
> And now VB.Net is telling me that I it "couldn't resolve default property
> of object NewRGBPoint(i) in these lines:
>
>                             For i = 0 To 8
>                                 'UPGRADE_WARNING: Couldn't resolve default
> property of object NewRGBPoint(i). Click for more:
> 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
>                                 NewRGBPoint(i) = LongToRGB(lColor(i))
>                                 lTemp = lTemp +
> GetBrightness(NewRGBPoint(i))
>                             Next i
>
> What I found in the MSDN what a bit of a joke or at least not
> understandable: "Create an array!". Aha, I thought that was what I did...
>
> Can anybody please help?
> Thanks.
> Herbert.
Author
13 Aug 2006 7:14 PM
GhostInAK
Hello Herbert,

You may wish to use the new Color structure in .NET.

-Boo

Show quoteHide quote
> Hello,
>
> I want to upgrade my VB6 project to VB.Net Express.
>
> I have a type, and I dim an array from it.
>
> This is what I have.
>
> Private Structure TColorRGB
> Dim Red As Integer
> Dim Green As Integer
> Dim Blue As Integer
> End Structure
> And what I do is:
>
> Dim NewRGBPoint(8) As TColorRGB
>
> And now VB.Net is telling me that I it "couldn't resolve default
> property of object NewRGBPoint(i) in these lines:
>
> For i = 0 To 8
> 'UPGRADE_WARNING: Couldn't resolve
> default property of object NewRGBPoint(i). Click for more:
> 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="
> 6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
> NewRGBPoint(i) = LongToRGB(lColor(i))
> lTemp = lTemp +
> GetBrightness(NewRGBPoint(i))
> Next i
> What I found in the MSDN what a bit of a joke or at least not
> understandable: "Create an array!". Aha, I thought that was what I
> did...
>
> Can anybody please help?
> Thanks.
> Herbert.