Psch,
I'm checking.......
It should word as your example.
I've reproduced your sample script into Power Basic code and it works.
I will let you know.
Ciao
Eros
Hi,
I'm bit lost.
The original declaration of LoadImage is
As TB still doesn't support strings, I tried the strptr trick, but still no successDECLARE FUNCTION LoadImage LIB "USER32.DLL" ALIAS "LoadImageA" (BYVAL hInst AS DWORD, lpsz AS ASCIIZ, BYVAL uType AS DWORD, BYVAL cxDesired AS LONG, BYVAL cyDesired AS LONG, BYVAL fuLoad AS DWORD) AS DWORD
Any ideas ?DECLARE FUNCTION LoadImage LIB "USER32.DLL" ALIAS "LoadImageA" (BYVAL hInst AS DWORD, lpsz AS dword, BYVAL uType AS DWORD, BYVAL cxDesired AS LONG, BYVAL cyDesired AS LONG, BYVAL fuLoad AS DWORD) AS DWORD %IMAGE_BITMAP = 0 %LR_LOADFROMFILE = &H0010 DIM hImg AS DWORD DIM picture AS STRING = App_SourcePath+"mybmp.bmp" picture += chr$(0) hImg = LoadImage ( %NULL, strptr(picture), %IMAGE_BITMAP, 0, 0, %LR_LOADFROMFILE) msgbox 0,"Handle obtained: "+FORMAT$(hImg)+$CRLF+"ImageFile: "+picture
Thanks,
Psch
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Psch,
I'm checking.......
It should word as your example.
I've reproduced your sample script into Power Basic code and it works.
I will let you know.
Ciao
Eros
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Psch,
I've found the problem: it is a bug!
Internal function used to call windows API was not returning any value to the script
Return value was just ignored. Your script example with STRPTR trick was right.
Fix will be present into version 1.0.8.2
Thanks a lot
Eros
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks