Hi Steven,
Did some googling and found a few good resolution, btw i have a new problem now. I already able to load the toolbar and one of the button is producing Activex component cant create object here is the script from where it occured:
Private Sub TabBlocks_Change()
Dim Pic As Picture
Dim sItemStr As String
Dim intIndex As Integer
Dim ItmList As ListItem
Dim sIniAppName As String
Dim sItemX As String, sItemY As String
Dim intlen As Integer, intItmCount As Integer
Dim sItemName As String, sItemBitmap As String, sItemCommand As String
Dim intItemX As Integer, intItemY As Integer, intImageIndex As Integer
If bInitialising Then Exit Sub
'Note that TabBlocks.Tabs is a zero base array while our ini file starts with 1
sIniAppName = "Tab" & TabBlocks.SelectedItem.Index + 1
intItmCount = GetPrivateProfileInt(sIniAppName, "ItemCount", 0, msIniFileName)
ListViewBlocks.ListItems.Clear
Set ListViewBlocks.Icons = Nothing
Set mImageListBlocks = Nothing 'Unload all the previous images explicitly
Set mImageListBlocks = New ImageList
For intIndex = 1 To intItmCount
sItemStr = GetProfileString(msIniFileName, sIniAppName, "Item" & intIndex, "Error")
If sItemStr <> "Error" Then
sItemName = GetToken(sItemStr, ",")
sItemBitmap = GetToken(sItemStr, ",")
sItemY = GetToken(sItemStr, ",")
sItemX = GetToken(sItemStr, ",")
sItemCommand = sItemStr
On Error Resume Next
Set Pic = Nothing
Set Pic = LoadPicture(msBmpDir & sItemBitmap)
On Error GoTo 0
If Not Pic Is Nothing Then
intImageIndex = mImageListBlocks.ListImages.Add(, , Pic).Index
If intImageIndex = 1 Then ListViewBlocks.Icons = mImageListBlocks
With ListViewBlocks.ListItems.Add(, , " ", intImageIndex)
.Left = (CInt(sItemX) - 1) * 35
.top = (CInt(sItemY) - 1) * 35
.tag = sItemCommand
End With
End If
End If
Next
ListViewBlocks.Refresh
End Sub
Somehow the error occurs in:
Set mImageListBlocks = New ImageList
What could be wrong.
Thanks,
Mayller