mattKnight
Programmer
I am getting this error with the following code; MSDN suggests that the cause is I am passing a module level array. I only pass indices to/from functions.
module level
Function
Anyone suffered from this before? and its hard to debug as this routine is part of a subclassed control...
As ever, further questions or more code snippets needed - ask me!
Thanks
Take Care
Matt
If at first you don't succeed, skydiving is not for you.
module level
Code:
Private udtLink() As LinkedListHolder
Function
Code:
'---------------------------------------------------------------------------------------
' Project : Project2 FormSizevbp.vbp
' Module : modSubClass modSubClass.bas
' Procedure : Function DeleteLinkedMember
' DateTime : 18/07/2005 09:43
' Author : Matthew Knight
' Purpose : Deletes Linked list member
'---------------------------------------------------------------------------------------
'
Private Function DeleteLinkedMember(lngIndex As Long) As Boolean
Dim blnResult As Boolean
Dim lngPrevious As Long
Dim lngNext As Long
Dim lngCount As Long
For lngCount = lngIndex To UBound(udtLink) - 1
'Temporary Store index values
lngPrevious = udtLink(lngIndex).nPreviousIndex
lngNext = udtLink(lngIndex).nNextIndex
' Shuffle array members down in memory
' Len(udtLink) = 20
'
CopyMemory udtLink(lngIndex), udtLink(lngIndex + 1), 20
' Write back index values
udtLink(lngIndex).nPreviousIndex = lngPrevious
udtLink(lngIndex).nNextIndex = lngNext
Next lngCount
'Redimension array to 1 smaller than it was
lngCount = UBound(udtLink) - 1
[COLOR=red]
'Error 10 Fixed array or temporarily locked at this redim line
ReDim Preserve udtLink(0 To lngCount) As LinkedListHolder[/color]
DeleteLinkedMember = blnResult
End Function
Anyone suffered from this before? and its hard to debug as this routine is part of a subclassed control...
As ever, further questions or more code snippets needed - ask me!
Thanks
Take Care
Matt
If at first you don't succeed, skydiving is not for you.