Silverfrost Forums

Welcome to our forums

%ss and browse_for_folder@ under 64bit

11 Sep 2016 8:01 #18006

Paul, in case of get_dib_block@ there are another two remarks:

  1. Please remember that get_dib_block@(and also get_dib_size@) crashes, when the jpeg identifier (JFIF-Tag = FF E0 00 10 4A 46 49 46 00 01 01 01 00 B4 00 B4 00 FF E1) is missing.This is unusual but allowed, for example the jpeg-files of my digitalcamera are without JFIF-Tag.
  2. Is it possible to extend get_dib_block@ also for png-files? This is one part of my wishlist.

Another part of my wishlist is a pendant to the (DOS)-command 'wget'. Now, I help me with WinExec('wget [option]...[url]',error), but this is not a good solution.

Thanks Chemie

12 Sep 2016 7:17 #18007

Items 1 and 2 might work if you were to call USE_GDIPLUS_IMAGE_FILES@. See cwplus.enh.

I am not familiar with wget but the routine DOWNLOAD@ might be appropriate. See ftn95.chm.

12 Sep 2016 2:50 #18012

Hi Paul, many thanks. Your Info was very useful for me. With read_url@ (the pendant to wget) and use_gdiplus_image_files@ I can get and display some png-files from the web four times faster than before. Chemie

12 Oct 2016 3:05 #18105

Hi, I always have problems with get_dib_block@. Look at my testprogram

  winapp
program pngtest
use mswin
implicit none

integer*4 xsize,ysize,a,bildctrl,picsizex,picsizey,urlmode
integer*4 func,mode,errcode,nbbp,ercode,urlerror,allocerror

character*255 filename,url
  character*1, dimension(:,:,:), allocatable :: picture

xsize=2048
  ysize=1536
xsize=256
  ysize=256

urlmode=1
bildctrl=0
url='http://tile.openstreetmap.org/15/16515/12525.png'
filename='test.png'

  a=winio@('%ca[test]&')
  a=winio@('%gr&',xsize,ysize)
  a=winio@('%lw',bildctrl)

call read_url@(url,filename,urlmode,urlerror)
a=use_gdiplus_image_files@(1)
call get_dib_size@(filename,picsizex,picsizey,nbbp,ercode)

allocate(picture(3,picsizex,picsizey),stat=allocerror)

call get_dib_block@(filename,picture,picsizex,picsizey,0,0,picsizex,picsizey,0,0,errcode)

  a=winio@('%ca[Result]&')
  a=winio@('%nlResult: %wd   %wd   %wd   %wd   %wd   %wd&',picsizex,picsizey,urlerror,nbbp,ercode,errcode)
  a=winio@('%2nl%cn%9`bt[OK]')

call display_dib_block@(0,0,picture,picsizex,picsizey,0,0,xsize,ysize,func,mode,errcode) 

end

when I use 256 for xsize, ysize, all is going well, but the errorcodes are wrong, there will be errcode=2(read error) for get_dib_size@ and 1 for get_dib_block@ (this error is not reported). But when I alter xsize and ysize to e.g. 2048 and 1536, the grogram crashes. Why I can't insert a small picture in a big graphics area? Thanks for your help Chemie

12 Oct 2016 3:10 #18106

Sorry, my fault, the program crashes not, when I use the correct values in display_dib_block@:

call display_dib_block@(0,0,picture,picsizex,picsizey,0,0,picsizex,picsizey,func,mode,errcode)

but the errcodes are always incorrect.

Chemie

30 Oct 2016 10:20 #18271

Sorry, I have rearranged my testprogram new.

  winapp
program pngtest
use mswin
implicit none

integer*4 xsize,ysize,a,imagectrl,picsizex,picsizey,urlmode
integer*4 func,mode,nbbp,urlerror,sizeerrcode,allocerror,blockerrcode,displayerrcode

character*255 filename,url
  character*1, dimension(:,:,:), allocatable :: picture

xsize=1200
  ysize=900

urlmode=1
url='http://tile.openstreetmap.org/15/16515/12525.png'
filename='test.png'
call read_url@(url,filename,urlmode,urlerror)
  
  a=winio@('%ca[test]&')
  a=winio@('%gr&',xsize,ysize)
  a=winio@('%lw',imagectrl)

a=use_gdiplus_image_files@(1)
call get_dib_size@(filename,picsizex,picsizey,nbbp,sizeerrcode)

allocate(picture(3,picsizex,picsizey),stat=allocerror)

call get_dib_block@(filename,picture,picsizex,picsizey,0,0,picsizex,picsizey,0,0,blockerrcode)
call display_dib_block@(0,0,picture,picsizex,picsizey,0,0,picsizex,picsizey,func,mode,displayerrcode)
  
  a=winio@('%ca[Result]&')
  a=winio@('%nlUrl_error: %wd&',urlerror)
  a=winio@('%nlImagesize: %wd   %wd&',picsizex,picsizey)      
  a=winio@('%nlGet_dib_size_error: %wd&',sizeerrcode)
  a=winio@('%nlAlloc_error: %wd&',allocerror) 
  a=winio@('%nlGet_dib_block_error: %wd&',blockerrcode)
  a=winio@('%nlDisplay_dib_block_error: %wd&',displayerrcode)
  a=winio@('%2nl%cn%9`bt[OK]')

end

Why I get an error (errcode=2) in get_dib_size@. Is that only my pc, who produce the error? The file test.png was ok, I can read the file with several programs without errors. What is about the error (errcode=1) of get_dib_block@? This error is not in the errorlist of get_dib_block@. The display is ok, therefor it is not understandable, that the errcodes are not zero. Thanks for your help. Chemie

2 Jan 2017 10:38 #18644

Hi Paul, first, a happy new year for you and all others. Now, I have problems with your newdlls14 and newdlls15. I have tryed them and I get with the following program an error:

winapp
  
  program integer7test
use mswin
implicit none

  integer*4 a,xpic,ypic,picctrl
  integer(7) pichandle

xpic=1000
ypic=800

a=winio@('%ca[Picture]&')
a=winio@('%gr&',xpic,ypic)
  a=winio@('%hw&',pichandle)
a=winio@('%lw',picctrl)

  end

pichandle is definitly integer(7), but the program crashes. Perhaps, there are further newdlls, where can I get the latest newdlls? Thanks Chemie

2 Jan 2017 4:50 #18645

Chemie

I think that the problem is that there is now a miss-match between the compiler and the DLLs. This is the danger when pre-releasing DLLs for testing whilst still using the main release of the compiler.

It may be necessary to wait for the next full release before this issue is resolved.

2 May 2018 8:30 #22057

A long time ago this thread noted issues with browse_for_folder@ which Paul then told us was fixed. Has anyone seen any regressions?

I don't think my program could get any simpler but always ends up with an access violation at the moment:

winapp

program bug
  use mswin

  character(len=50) :: temp

  if( browse_for_folder@('Folder?',temp) )then
    write(*,*) temp
  else
    write(*,*) 'Failed'
  endif

  stop 0
end program

We get

Error: Access Violation reading address 0x0

GET_CSTRING@ BUG

Does anyone have any ideas please? We're using 8.30

2 May 2018 9:45 #22058

You just need a larger character variable...

character(len=550) :: temp 

Maybe ClearWin+ can be made to send you a warning.

4 May 2018 7:47 #22069

Thanks Paul, a) not sure why that didn't occur to me and b) interesting that the requirement has changed between 32 and 64bit!

24 May 2018 8:33 #22160

Hi John-Silver,

The 'folder creation' flag is BIF_NONEWFOLDERBUTTON (0x00000200)

My understanding is that if you wanted to use this flag you would also need to use the New Dialog Style BIF_NEWDIALOGSTYLE (0x00000040) so therefore you would use z'240' as the flag as the individual flags can be added together. I'm not entirely sure what the z indicates but I assume it's so ensure the flag value gets passed through in the correct format for UINT.

Regards Simon

Please login to reply.