>oiconBuddy = null >oIconBuddy = newobject("iconbuddy", "iconbuddy") > >local loLarge, loSmall > >? oIconBuddy.GetassociconPairobjects(getfile("XLS"), @loLarge, @loSmall, .T.) > >? oIconbuddy.icon2bitmap( losmall.Handle, "Frank_Small.bmp" ) >? oIconbuddy.icon2bitmap( loLarge.Handle, "Frank_Large.bmp" ) >>
>lparameters tcSourceFile, tcBitmapLarge, tcBitmapSmall >LOCAL lnRetVal, loLarge, loSmall, lnX, lnIcons, loIB >tcSouceFile = iif(vartype(tcSouceFile) = "C", tcSouceFile, "") >tcBitmapLarge = iif(vartype(tcBitmapLarge) = "C", tcBitmapLarge, "IconBuddy"+ sys(2015) +".bmp") >tcBitmapSmall = iif(vartype(tcBitmapSmall) = "C", tcBitmapSmall, "IconBuddy"+ sys(2015) +".bmp") > >lnRetVal = -1 > >if empty(tcSourceFile) or ! file(tcSourceFile) > this.cErrorText = IconBuddyErr_MissingSourceFile > return lnRetVal >endif > >if empty(tcBitmapLarge) and empty(tcBitmapSmall) > this.cErrorText = IconBuddyErr_NoTargetFile > return lnRetVal >endif > >loLarge = null >loSmall = null > >*-- now get the Icon-Objects and keep the handles >lnIcons = this.GetAssocIconPairObjects(tcSourceFile, @loLarge, @loSmall, .T.) > >if lnIcons <= 0 > this.cErrorText = IconBuddyErr_NoIconsFound > return lnRetVal >endif > > >? loLarge.Handle <- Error !!!!!!!! > > >lnX = 0 > >if ! empty(tcBitmapLarge) and ! isNull(loLarge) > > *-- Save the large Icon > if this.icon2bitmap( loLarge.Handle, tcBitmapLarge, .T.) > lnX = lnX + 1 > endif > >endif > >..... > >>