VB6.CopyArray Question

I have tried to converet Fresle's CGenericRegistration and CMD5 classes from VB6 to VB.Net 2005. (www.frez.co.uk/registration.zip) The wizard converts the TestRegistration program, which includes the classes and two others, and runs fine when AscB is replaced with Asc, although the results are not the same. The wizard inserts the following code in the ConvertToWordArray function:

ConvertToWordArray = vb6.copyarray (lWordArray)

This works great when run in the IDE but when the classes are put into a class library this line gives a "VB6 not defined" type error.
The following import statement is in both the TestRegistration program and the Class Library project:

Imports VB = Microsoft.VisualBasic

I have been unable to find where the VB6.CopyArray method is located or what method is available to duplicate the functionality.
Any help would be greatly appreciated. Both VB6 and VB.Net 2005 versions follow.

Private Function ConvertToWordArray(sMessage As String) As Long()
Dim lMessageLength As Long
Dim lNumberOfWords As Long
Dim lWordArray() As Long
Dim lBytePosition As Long
Dim lByteCount As Long
Dim lWordCount As Long
Dim lChar As Long

' Combine each block of 4 bytes (ascii code of character) into one long
' value and store in the message. The high-order (most significant) bit of
' each byte is listed first. However, the low-order (least significant) byte
' is given first in each word.
lBytePosition = 0
lByteCount = 0
Do Until lByteCount >= lMessageLength
' Each word is 4 bytes
lWordCount = lByteCount \ BYTES_TO_A_WORD

' Terminate according to MD5 rules with a 1 bit, zeros and the length in
' bits stored in the last two words
lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE

' Add a terminating 1 bit, all the rest of the bits to the end of the
' word array will default to zero
lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(&H80, lBytePosition)

' We put the length of the message in bits into the last two words, to get
' the length in bits we need to multiply by 8 (or left shift 3). This left
' shifted value is put in the first word. Any bits shifted off the left edge
' need to be put in the second word, we can work out which bits by shifting
' right the length by 29 bits.
lWordArray(lNumberOfWords - 2) = LShift(lMessageLength, 3)
lWordArray(lNumberOfWords - 1) = RShift(lMessageLength, 29)

' Combine each block of 4 bytes (ascii code of character) into one long
' value and store in the message. The high-order (most significant) bit of
' each byte is listed first. However, the low-order (least significant) byte
' is given first in each word.
lBytePosition = 0
lByteCount = 0
Do Until lByteCount >= lMessageLength
' Each word is 4 bytes
lWordCount = lByteCount \ BYTES_TO_A_WORD

' Terminate according to MD5 rules with a 1 bit, zeros and the length in
' bits stored in the last two words
lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE

' Add a terminating 1 bit, all the rest of the bits to the end of the
' word array will default to zero
lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(&H80s, lBytePosition)

' We put the length of the message in bits into the last two words, to get
' the length in bits we need to multiply by 8 (or left shift 3). This left
' shifted value is put in the first word. Any bits shifted off the left edge
' need to be put in the second word, we can work out which bits by shifting
' right the length by 29 bits.
lWordArray(lNumberOfWords - 2) = LShift(lMessageLength, 3)
lWordArray(lNumberOfWords - 1) = RShift(lMessageLength, 29)

Thanks for the suggestion. Unfortunately, that did not resolve the problem, but I am sure you are on the right track. Going down to the VisualBasic.Compatibility.VB6 namespace did not help as CopyArray is not in the namespace.

I did some more testing this morning and discovered what I should have discovered at first:

ConvertToWordArray = lWordArray

and

ConvertToWordArray = VB6.CopyArray(lWordArray)

yielded exactly the same ConvertToWordArray result. That meant the problem was really in the calling program. I found it and all is now well.

I will close this question even though it means I may never know where VB6.CopyArray really exists.