76
Visual Basic 6 / Re:ucImage.LoadImageFromRes ???
« en: Mayo 07, 2013, 06:02:47 pm »
Found a bug in LoadImageFromRes
I will tell Leandro so he can update the control. Ill Attach an example anyway
https://dl.dropboxusercontent.com/u/43394978/Code/ucImageList.rar
Código: [Seleccionar]
Public Function LoadImageFromRes( _
ByVal ResIndex As Variant, _
ByVal ResSection As Variant, _
Optional VBglobal As IUnknown) As Boolean
Dim bvData() As Byte
Dim oVBglobal As VB.Global
On Local Error GoTo LoadImageFromCustomRes_Error
If VBglobal Is Nothing Then
Set oVBglobal = VB.Global
ElseIf TypeOf VBglobal Is VB.Global Then
Set oVBglobal = VBglobal
ElseIf VBglobal Is Nothing Then
Set oVBglobal = VB.Global
End If
bvData = oVBglobal.LoadResData(ResIndex, ResSection)
c_bvData() = bvData '<----/////////////////////////////////////////////// This line must be added here
LoadImageFromRes = LoadFromStream(bvData)
Call UserControl.Cls
Call LoadFromStream(bvData)
Call UserControl_Paint
LoadImageFromCustomRes_Error:
End Function
I will tell Leandro so he can update the control. Ill Attach an example anyway
https://dl.dropboxusercontent.com/u/43394978/Code/ucImageList.rar