Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with DLL
Message
From
06/07/2000 18:48:19
Steve Summers
Pima County Superior Court
Tucson, Arizona, United States
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Help with DLL
Miscellaneous
Thread ID:
00389236
Message ID:
00389236
Views:
56
I read you thread entitled "VFP5 to 6 Upgrade for jpg". I am working on a project where the API code you supplied will do exactly what I need to do. I was hoping you could help me. I am recieving the following Error: "Cannot load 32-bit DLL ImgDLL" My clients are using WIN95. I am testing on WIN98. Could this be the problem?


Here is the code:
PROCEDURE RESIZE
PARAM CINPUTFILE,COUTPUTFILE,ULEFT, UTOP, URIGHT, UBOTTOM,IQUALFACTOR

DECLARE INTEGER ImgDLLReadRGBFromJPG IN ImgDLL STRING @Filename, INTEGER @WIDTH, INTEGER @HEIGHT
DECLARE INTEGER ImgDLLCropRGB IN ImgDLL INTEGER pRGB, INTEGER InW, INTEGER inH, INTEGER uLeft, INTEGER uTop, INTEGER uRight, INTEGER uBottom
DECLARE INTEGER ImgDLLSaveRGBToJPG IN ImgDLL STRING @FileName, INTEGER pRGBBuf, INTEGER W, INTEGER H, INTEGER Qual, INTEGER ColorFlag, INTEGER ProgressiveFlag
DECLARE GlobalUnlock IN Win32API INTEGER hpRGB
DECLARE GlobalFree IN Win32API INTEGER hpRGB
DECLARE INTEGER GlobalLock IN Win32API INTEGER hpRGB

IWID=0
IHEIGHT=0
HPRGB=IMGDLLREADRGBFROMJPG(@CINPUTFILE,@IWID,@IHEIGHT) && Read image from disk
IF HPRGB = 0
MESSAGE("Reading input file")
RETURN
ENDIF
PRGB=GLOBALLOCK(HPRGB)
IF PRGB = 0
* This should never happen
GLOBALFREE(HPRGB)
ERRMSG("Getting global lock on input buffer")
RETURN
ENDIF
HPRGBNEW=IMGDLLCROPRGB(PRGB, IWID, IHEIGHT, ULEFT, UTOP, URIGHT, UBOTTOM)
IF HPRGBNEW = 0
* Error happened
GLOBALUNLOCK(HPRGB) && Free the original input file's buffer
GLOBALFREE(HPRGB)
ERRMSG("Cropping file")
RETURN
ENDIF
PRGBNEW=GLOBALLOCK(HPRGBNEW) && Lock the cropped image buffer
GLOBALUNLOCK(HPRGB) && Free the original input file's buffer
GLOBALFREE(HPRGB)
NEWIWID=URIGHT-ULEFT
NEWIHEIGHT=UBOTTOM-UTOP
ISTAT=IMGDLLSAVERGBTOJPG(@COUTPUTFILE, PRGBNEW, NEWIWID, NEWIHEIGHT,IQUALFACTOR, 1,0)
IF ISTAT <> 1
ERRMSG("Saving to resized JPG")
ENDIF
GLOBALUNLOCK(HPRGBNEW)
GLOBALFREE(HPRGBNEW) && Free the cropped image buffer
RETURN


PROCEDURE ERRMSG
LPARAM TXTINFO
PRIV ISTAT
ISTAT=IMGDLLGETLASTERROR()
MSG("ImgDLL Error " + TXTINFO + ", error: " + ALLT(STR(ISTAT)) )
RETURN
Thanks in advance or I hope this helps!

[STS]
:>
Next
Reply
Map
View

Click here to load this message in the networking platform