View previous topic :: View next topic |
Author |
Message |
AlanVardy
Joined: 17 Dec 2013 Posts: 16
|
Posted: Mon Aug 19, 2024 4:52 pm Post subject: Old code creating a screen fails with new Salflibc.dll |
|
|
I use FTN95 extensively for engineering numerical analysis, but have not used ClearWin since developing a rather simple graphics program in 2009. In that respect, I am a novice in the extreme.
The following code to create a window still worked okay when compiled with Salflibc.dll (29 April 2019), but that executable failed when run with Salflibc.dll (3 Nov 2019). I recompiled with the new Salflibc, but this also fails.
RESULT = WINIO@('%CA@&',WINDOWH)
!
RESULT = WINIO@('%SY[3D]&')
!
RESULT = WINIO@('%ww[no_border]&')
!
RESULT = WINIO@('%es&')
!
RESULT = WINIO@('%WW%PV&')
!
RESULT = WINIO@('%sp&',50L,10L)
!
! User- options on the menu line (triggering Call-back functions):
!
RES2 = WINIO@('%mn[&File[&Print,|,&BMP file,|,&PCX file,|,E&xit]]&', &
& DESKJ,BMP_FILE,PCX_FILE,'EXIT')
!
RES2 = WINIO@('%mn[&Back,&Next]&',back,next)
!
RES2 = WINIO@('%mn[&Help[&About GraphTun]]&',ABOUT)
!
RES2 = WINIO@('%`GR[GREY,METAFILE_RESIZE]&', NXPIXEL,NYPIXEL,HANDSCRN)
!
RESULT = WINIO@('%LW', IWIN1)
!
RETURN
Each WINIO@ instruction before the last returns the result -1. Then the %LW instruction causes fails and displays a failure message entitled:
Call_StackStatus Exception 0xC000041D 'Unknown'
The first two of many lines in the failure window are :
76e21b7b 648025CA0F0000FE ANDB FS:[00000FCA],0xFE +00000
76e21b83 817C2404CDABBADC CMP [ESP+0x4],0xDCBAABCD +00008
Such lines are meaningless to me, but perhaps someone will recognise something.
I will gladly provide any other information on request. In the meantime, is this enough to give any a clue to the likely cause? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Mon Aug 19, 2024 5:23 pm Post subject: |
|
|
If this code is within a subprogram then IWIN1 must not be a local variable.
For example, you could give it the SAVE attribute. |
|
Back to top |
|
|
AlanVardy
Joined: 17 Dec 2013 Posts: 16
|
Posted: Mon Aug 19, 2024 5:55 pm Post subject: |
|
|
Greetings Paul - and thanks for such a rapid response.
IWIN1 is declared in a module. I did not include declarations in the post, but could do so if desired. However, the whole program has worked for 15 years (except for a revision needed when the default for colours changed from RGB some years ago). Now it fails. The code must include something that Salflibc no longer allows, but I have no idea how to search for it.
Just in case... in response to a suggestion from Robert C, I now use "USE MSWIN" instead of CALL <INCLUDE.INS>. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Mon Aug 19, 2024 7:05 pm Post subject: |
|
|
Alan
Can you provide a working program that illustrates this failure.
If necessary, zip up your code and provide a link via DropBox or similar. |
|
Back to top |
|
|
AlanVardy
Joined: 17 Dec 2013 Posts: 16
|
Posted: Mon Aug 19, 2024 7:51 pm Post subject: |
|
|
That sounds like a wonderful offer, Paul.
I would be very happy indeed to provide everything, including:
1. All the source code files files
2. Two batch files that are used to create an executable
(one for compilation; another for linking)
3. A sample data file to drag and drop onto resulting executables
4. A .screenshot showing what the output looks like with the previous executables and the 2019 Salflibc.dll
However, is this what you are suggesting? It sounds too good to be true.
Alan |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Mon Aug 19, 2024 9:22 pm Post subject: |
|
|
Yes. If you can't create a small demonstrator then send it all. |
|
Back to top |
|
|
AlanVardy
Joined: 17 Dec 2013 Posts: 16
|
Posted: Tue Aug 20, 2024 7:43 am Post subject: |
|
|
True thanks, Paul.
I shall try first to create a shorter demo. |
|
Back to top |
|
|
AlanVardy
Joined: 17 Dec 2013 Posts: 16
|
Posted: Tue Aug 20, 2024 5:01 pm Post subject: |
|
|
Paul
For security reasons, I have forwarded a link by email.
Alan |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Wed Aug 21, 2024 9:34 am Post subject: |
|
|
Alan
The basic problem relates somehow to METAFILE_RESIZE. If you leave it out the it's basically OK.
Do you need it? I would need more time to work out what is going wrong.
Some other details...
1) FNTNAME in g_infont.f95 has too few characters (try 128 say).
2) HANDSCRN in g_module_glo.f95 should be a 32 bit integer.
3) You do not need to initialise IWIN1. It is initialised by ClearWin+. |
|
Back to top |
|
|
AlanVardy
Joined: 17 Dec 2013 Posts: 16
|
Posted: Wed Aug 21, 2024 10:25 am Post subject: |
|
|
Dear Paul
Wow. That was quick.
1. I can live without METAFILE_RESIZE until the problem is fixed - and that should NOT be regarded as an urgent matter. I'll simply tell users that I will reintroduce the facility "sometime".
2. Thank you for the detailed supplementary comments. Very helpful.
NB: I used INTEGER TYPE 7 so that it is possible to compile with either 32 or 64 without changing the code. That suggestion is in your Help documents.
Hopefully, I'll confirm later today that all now works fine. First = dental appointment. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Wed Aug 21, 2024 10:49 am Post subject: |
|
|
Alan
I have now located and fixed the bug in ClearWin+ that raises the exception but this resizing mechanism no longer works, at least not for me. The image is erased and not redrawn.
There is an alternative user_resize but it requires more work from the programmer.
I will log this as a bug that needs fixing.
The 32 bit integer that I mentioned is 32 bits for both Win32 and x64. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Wed Aug 21, 2024 3:15 pm Post subject: |
|
|
This failure to redraw the image has now been fixed for the next release of ClearWin+. |
|
Back to top |
|
|
AlanVardy
Joined: 17 Dec 2013 Posts: 16
|
Posted: Wed Aug 21, 2024 5:35 pm Post subject: |
|
|
Paul
Sad to say, I cannot report success.
I have removed the METAFILE_RESIZE instruction and implemented the changes you indicated.
The %LW instruction now sets IWIN1=-1, but returns a RESULT of "0" and the subsequent CALL DRAW_FILLED_RECTANGLE (in the subroutine G_PAGE) fails, stating that there is no graphics window open.
Do you have any other thoughts about what I might try?
(Sorry)
Alan |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8017 Location: Salford, UK
|
Posted: Wed Aug 21, 2024 6:23 pm Post subject: |
|
|
Alan
I may need to send your code back. I might have made other changes.
I tested for x64 and not Win32. I used Plato directly rather than your batch files. If I have time I will check again tomorrow. |
|
Back to top |
|
|
AlanVardy
Joined: 17 Dec 2013 Posts: 16
|
Posted: Thu Aug 22, 2024 5:46 am Post subject: |
|
|
Paul
Thanks yet again. I am happy to wait. Although obviously important for me, this is NOT urgent.
Alan |
|
Back to top |
|
|
|