Page 1 of 1

Error TIMAGE:_HDIB

Posted: Sun Oct 12, 2008 3:32 am
by dutch
Dear Antonio,

I found this error in one my client's network W2003R2. I didn't found this error before and in other computer or network have no problem. I've found in Basil forum but I cannot read Spanish.

I use Clipper 5.2e/FW2.5/Blinker 7.0

Code: Select all

   Error description: Error Objects/6  No Exp. Method: TIMAGE:_HDIB

Stack Calls
===========
   Called from LOCKERRHAN(0)
   Called from (b)INITHANDL$(0)
   Called from TIMAGE:_HDIB(0)
   Called from TIMAGE:NEW(55)
Thanks&regards,
Dutch

Posted: Sun Oct 12, 2008 8:43 am
by Antonio Linares
Dutch,

Please check that your Class TImage (or TBitmap) has a DATA hDib.

Also notice that in more recent FW builds, such DATA was removed.

Posted: Sun Oct 12, 2008 3:10 pm
by dutch
Dear Antonio,

I've modified TImage with new data.
It's fixed it

Thanks&regards,
Dutch

Posted: Wed Dec 10, 2008 2:40 pm
by Softlog86
Hello , Friends !

I'm insert string : DATA hDib into file IMAGE.PRG ..... complile by CLIPPER 5.3 .... Linking ..... but have error :

No Exp Method TIMAGE:HBITMAP .....

Please give me good IMAGE.PRG file !!!

Posted: Wed Dec 10, 2008 2:55 pm
by Antonio Linares
You should include:

DATA hBitmap

what FiveWin version are you using ?

Posted: Thu Dec 11, 2008 10:15 am
by Softlog86
Version ..... :) ?

Installed 2.1
upgraded to 2.1B ---> 2.1C .... But I dont't know how check version ...

FIVE.LIB 1061463 bytes
FIVEC.LIB 449021 bytes .....



Antonio !
I'm change IMAGE.PRG :

....................


Freeimage.DLL only for 32 bit app ???


CLASS TImage FROM TBitmap

DATA nProgress

DATA hBitmap (<----- New string

DATA hDib (<---- New string

DATA hPalette (<----- New String

CLASSDATA lRegistered AS LOGICAL

METHOD New( nTop, nLeft, nWidth, nHeight, cResName, cBmpFile, lNoBorder,;
oWnd, bLClicked, bRClicked, lScroll, lStretch, oCursor,;
cMsg, lUpdate, bWhen, lPixel, bValid, lDesign ) CONSTRUCTOR

************************************

But new collision : MSGSTOP : Cannot load FREEIMAGE.DLL . This file in CURRENT directory !!!!!

Posted: Fri Dec 12, 2008 10:47 pm
by dutch
let see this code.

Code: Select all

#include "FiveWin.ch" 

#define CBM_INIT 4    // for freeimage.dll

#define DIB_RGB_COLORS 0 // for freeimage.dll

STATIC hLib              // for freeimage.dll

FUNCTION SaveImage( cFile ) 
LOCAL nFormat, hDib, hInfoH, hInfo, hBits, hWnd, hDC, hBmp, lOk

#ifdef __CLIPPER__ 
    hLib = LOADLIB32( "freeimage.dll" ) 
#else 
    hLib = LOADLIBRARY( "freeimage.dll" ) 
#endif 

    if hLib <= 32 
        MsgStop( "Cannot load FreeImage.dll" ) 
        return 0 
    endif 

    nFormat := FIGETFILETYPE( cFile, 0 ) 
    hDib    := FILOAD( nFormat, cFile, 0 ) 
    hInfoH  := FIGETINFOHEADER( hDib ) 
    hInfo   := FIGETINFO( hDib ) 
    hBits   := FIGETBITS( hDib ) 
    hWnd    := GETDESKTOPWINDOW() 

#ifdef __CLIPPER__ 
    hDC = GETDC32( hWnd ) 
#else 
    hDC = GETDC( hWnd ) 
#endif 

lOk := FISAVE( 2 , hDib, cFile )

hBmp = CREATEDIBITMAP( hDC, hInfoH, CBM_INIT, hBits, hInfo, DIB_RGB_COLORS ) 

#ifdef __CLIPPER__ 
    RELEASEDC32( hWnd, hDC ) 
#else 
    RELEASEDC( hWnd, hDC ) 
#endif 

FIUNLOAD( hDib )

#ifdef __CLIPPER__ 
    FREELIB32( hLib ) 
#else 
    FREELIBRARY( hLib ) 
#endif 
RETURN hBmp 

DLL32 STATIC FUNCTION FIGETFILETYPE( cFileName AS LPSTR, nSize AS LONG ) AS LONG;
      PASCAL FROM "_FreeImage_GetFileType@8" LIB hLib

DLL32 STATIC FUNCTION FILOAD( nFormat AS LONG, cFileName AS LPSTR, nFlags AS LONG ) AS LONG;
      PASCAL FROM "_FreeImage_Load@12" LIB hLib

DLL32 STATIC FUNCTION FIUNLOAD( hDib AS LONG ) AS VOID; 
      PASCAL FROM "_FreeImage_Unload@4" LIB hLib

DLL32 STATIC FUNCTION FIGETINFOHEADER( hDib AS LONG ) AS LONG;
      PASCAL FROM "_FreeImage_GetInfoHeader@4" LIB hLib

DLL32 STATIC FUNCTION FIGETINFO( hDib AS LONG ) AS LONG;
      PASCAL FROM "_FreeImage_GetInfo@4" LIB hLib

DLL32 STATIC FUNCTION FIGETBITS( hDib AS LONG ) AS LONG;
      PASCAL FROM "_FreeImage_GetBits@4" LIB hLib

DLL32 STATIC FUNCTION FISAVE( nFormat AS LONG, hDib AS LONG, cFileName AS LPSTR, nFlags AS LONG ) AS BOOL;
      PASCAL FROM "_FreeImage_Save@16" LIB hLib

DLL32 STATIC FUNCTION GETDC32( hWnd AS LONG ) AS LONG;
      PASCAL FROM "GetDC" LIB "user32.dll"

DLL32 STATIC FUNCTION RELEASEDC32( hWnd AS LONG ) AS LONG;
      PASCAL FROM "ReleaseDC" LIB "user32.dll"

DLL32 STATIC FUNCTION CREATEDIBITMAP( hDC AS LONG, hInfoH AS LONG, nFlags AS LONG, hBits AS LONG, hInfo AS LONG, nUsage AS LONG ) AS LONG;
      PASCAL FROM "CreateDIBitmap" LIB "gdi32.dll"

DLL32 FUNCTION WOWHANDLE16( nHandle AS LONG, nHandleType AS LONG ) AS LONG;
      PASCAL FROM "WOWHandle16" LIB "wow32.dll"

Posted: Sat Dec 13, 2008 12:31 am
by Antonio Linares
Are you using FWH 32 bits or FW 16 bits ?

Posted: Tue Dec 16, 2008 8:27 am
by Softlog86
I'm use FW for CLIPPER (2.1) (16 bit ? :) )

Posted: Tue Dec 23, 2008 8:13 am
by Antonio Linares
Thats an old version. You should upgrade to a more recent FW build.

Our best advise is that you migrate your app to 32 bits using Harbour/xHarbour and FWH.

Posted: Wed Dec 24, 2008 9:28 am
by Softlog86
I don't have any FW for Harbour distributives ..... Do you help me for this problem ? I'm write NOT commercial software ..... Programming is my hobby :)

Posted: Wed Dec 24, 2008 10:39 am
by Antonio Linares
FiveWin is a commercial product.

You can order it from www.fivetechsoft.com purchase section, thanks