Error TIMAGE:_HDIB

Post Reply
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Error TIMAGE:_HDIB

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Post by dutch »

Dear Antonio,

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

Thanks&regards,
Dutch
Softlog86
Posts: 4
Joined: Mon Dec 01, 2008 2:06 pm

Post 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 !!!
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

You should include:

DATA hBitmap

what FiveWin version are you using ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Softlog86
Posts: 4
Joined: Mon Dec 01, 2008 2:06 pm

Post 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 !!!!!
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Post 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"
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Are you using FWH 32 bits or FW 16 bits ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Softlog86
Posts: 4
Joined: Mon Dec 01, 2008 2:06 pm

Post by Softlog86 »

I'm use FW for CLIPPER (2.1) (16 bit ? :) )
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Softlog86
Posts: 4
Joined: Mon Dec 01, 2008 2:06 pm

Post 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 :)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

FiveWin is a commercial product.

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

Antonio Linares
www.fivetechsoft.com
Post Reply