The code works fine when I have this code in the form that is using it.
However when I define it as public and use it in a class like this, I have problems.
Specifically I get this error message when it is called from a form.
Compile Error:
Function call on left-hand side of assignment must return Variant or Object
I don't think it should return Variant or Object, because I specifically defined it to return Byte() when I defined the function. Is there something I'm missing here? Are byte arrays not a valid output type for functions that are in classes? Some help here would be nice.
Code:
Private Function GetPix() As Byte()
CopyMemory Pix(0, 0, 0), ByVal BitsPtr, 4 * PicW * PicH
GetPix() = Pix()
End Function
Code:
Public Function GetPix() As Byte()
CopyMemory Pix(0, 0, 0), ByVal BitsPtr, 4 * PicW * PicH
GetPix() = Pix()
End Function
Quote:
Compile Error:
Function call on left-hand side of assignment must return Variant or Object