trying to load a dll function to convert bmp to jpg doesnt seem to create the jpg though the getprocaddress is returning a null

push OFFSET TheDLL
call LoadLibrary ;/// Load the bmp2jpeg.dll into our process
push OFFSET TheFunction
push eax
call GetProcAddress ;/// Get address of BmpToJpeg function
cmp eax, 0
jnz error
mov esi, eax
push 100d
push OFFSET jpgfile
push OFFSET bmpfile
call esi
jmp endit
;push esi
;call FreeLibrary
error:
invoke MessageBox,0,addr bah,addr bah,0
endit:
invoke ExitProcess,0
the asm and dll can be downloaded here/;

http://www.illmob.org/uploads/bmp2jpg.zip
Posted on 2002-07-04 02:34:18 by illwill
The dll seams to have no functions listed as exports
EDIT
oh it's compress the functions name is indeed BmpToJpeg so it looks as if your doing everything correct.
Posted on 2002-07-04 03:47:35 by Kudos
i cant get it to work if anyone can paste the fix in here

even tried

invoke LoadLibrary,addr TheDLL
mov hLib,eax
invoke GetProcAddress,hLib,addr TheFunction

.if eax==NULL
invoke MessageBox,0,addr bah,addr bah,0
.else
mov funcbuff,eax
push 100d
push OFFSET jpgfile
push OFFSET bmpfile
call
invoke FreeLibrary,hLib
.endif
invoke ExitProcess,NULL
Posted on 2002-07-04 04:09:09 by illwill
iw do you KNOW for SURE that the bmptojpeg function in the dll works?

I've had a go and LoadLibrary and GetProcAddress both succeed.
The only thing left are
1) the parameters are wrong what's the 100?
2) the function is not functioning ;)

where did you get the dll from?


a quick google for bmp2jpeg turned up THIS SITE
it seems other people have had the same problem..
Posted on 2002-07-04 05:37:21 by MArtial_Code
Private Declare Function BmpToJpeg Lib "Bmp2Jpeg.dll" (ByVal BmpFilename As String, ByVal JpegFilename As String, ByVal CompressQuality As Integer) As Integer

BmpToJpeg filename & ".bmp", filename & ".jpg", 100
is the way it was called from the vb project i got the dll from

the 100 is the compression ratio or quality of the jpg



yes that link is the same VB code where i got the dll from ... i used the vb project and the dll works for it with no problem i dont know if maybe im pushig the parameters wrong or something
Posted on 2002-07-04 11:59:00 by illwill
i think i stumped the great ones... everyone says the code looks correct but noone can figure out why it isnt working.... :confused:
Posted on 2002-07-04 18:32:02 by illwill
I found some code to do it. it's in c but could be converted to asm
http://www.catenary.com/howto/bmp2jpeg.html#c
Posted on 2002-07-05 09:01:17 by Kudos