 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
FLEXPLAN3D
Joined: 25 Feb 2011 Posts: 27
|
Posted: Mon Jan 13, 2014 1:02 pm Post subject: WINDOWS 8.1 and Microsoft Surface Pro Tablet |
|
|
Has anyone tried running a Fortran95 program on a tablet running Windows 8.1.
I tried this simple program which creates a window and a menu. The program crashes when I try operate the menu by touch or stylus. It works fine with a Mouse.
I have written the program for both Fortran 95 and C++ compilers and get the same problem.
It also crashes when using Visual Studio and Fortran95 express to build the executable.
Below is the Fortran program listing.
external t
integer t
I=WINIO@('%ca[A TEST WINDOW FOR TOUCH MENU]&')
I=WINIO@('%sz&',1000,500)
I=WINIO@('%sp&',200,200)
i=winio@('%mn[Alpha,Beta[beta1,beta2,beta3],Gamma]',t,t,t,t,t)
STOP
END
integer function t()
call msg(' menu item selected')
t=1
return
end
SUBROUTINE MSG(STR)
c----------------- win32 api ---------------------------------------
STDCALL MESSAGEBOX 'MessageBoxA' (VAL,REF,REF,VAL)
&:INTEGER*4
PARAMETER( MB_SYSTEMMODAL=Z'1000')
CHARACTER STR*(*)
ISTATUS =MESSAGEBOX(0,STR,'test'//char(0), MB_SYSTEMMODAL)
RETURN
END |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Jan 13, 2014 6:32 pm Post subject: |
|
|
Are you using the latest release of FTN95? |
|
Back to top |
|
 |
FLEXPLAN3D
Joined: 25 Feb 2011 Posts: 27
|
Posted: Mon Jan 13, 2014 7:07 pm Post subject: |
|
|
Paul
I have downloaded personal editions of both FTN95 (V7.00.0) and FTN95 express for this test. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Jan 14, 2014 9:31 am Post subject: |
|
|
Does a simple Fortran, program Work? |
|
Back to top |
|
 |
FLEXPLAN3D
Joined: 25 Feb 2011 Posts: 27
|
Posted: Tue Jan 14, 2014 4:36 pm Post subject: |
|
|
I have tried using the touch screen with a large program ,which exhibits the same problem i.e. it is fine with the mouse, but it can be made to crash when selecting the menu by touch.
I have also ported to the tablet an old version of 'paintshop pro version 6' which according to the 'About' screen was built in 1999. This works fine with touch.
I have tried a c++ program in which I have registered the application window for WM_TOUCH messages. The programs window procedure recognises the WM_TOUCH messages ok, but still crashes when selecting the menu by touch.
The program listing is shown below.-
// Touch test
#include <windows.h>
#ifndef WINVER
#define winver 0x0601
#endif
// trial code
#define WM_TOUCH 0x0240
#define WM_GESTURE 0x0119
WINUSERAPI BOOL WINAPI RegisterTouchWindow(HWND hwnd, ULONG ulFlags);
LRESULT WINAPI MainWndProc( HWND, UINT, WPARAM, LPARAM );
int CALLBACK WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR,win_int);
int CALLBACK WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,win_int nCmdShow)
{
HWND hWnd;
HWND ParentHandle;
WNDCLASS wc;
DWORD WindowStyle;
wchar_t *Alpha =L"Alpha" ;
wchar_t *Beta =L"Beta" ;
wchar_t *Beta1 =L"Beta1" ;
wchar_t *Beta2 =L"Beta2" ;
wchar_t *Beta3 =L"Beta3" ;
wchar_t *Gamma =L"Gamma" ;
int xtop,ytop,xbottom,ybottom;
char caption[50];
MSG Msg;
strcpy(caption,"Touch test");
xtop =300;
ytop =300;
xbottom = 800;
ybottom = 800;
ParentHandle =NULL;
WindowStyle = WS_OVERLAPPEDWINDOW |WS_VSCROLL |WS_HSCROLL
|WS_VISIBLE |WS_MAXIMIZE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
if (!hPrevInstance)
{
wc.style = CS_VREDRAW| CS_HREDRAW ;
wc.lpfnWndProc = MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = NULL; /* set by mouse movement */
wc.hbrBackground = (HBRUSH) (COLOR_WINDOW+1);;
wc.lpszMenuName = NULL ;
wc.lpszClassName = "TouchClass";
if (!RegisterClass(&wc))
MessageBox(NULL,"Unable to Register Class","touchclass",MB_OK) ;
}
hWnd = CreateWindow(
"touchclass",
caption,
WindowStyle,
xtop,
ytop,
xbottom,
ybottom,
ParentHandle,
NULL,
hInstance,
NULL
);
// trial code
// RegisterTouchWindow(hWnd,0);
ShowWindow(hWnd, nCmdShow);
// Menu
HMENU TheMenu = CreateMenu();
AppendMenuW(TheMenu, MF_STRING,1,Alpha);
HMENU BetaMenu = CreatePopupMenu();
AppendMenuW(BetaMenu, MF_STRING,21,Beta1);
AppendMenuW(BetaMenu, MF_STRING,22,Beta2);
AppendMenuW(BetaMenu, MF_STRING,23,Beta3);
AppendMenuW(TheMenu,MF_POPUP,(UINT)BetaMenu,Beta);
AppendMenuW(TheMenu, MF_STRING,3,Gamma);
SetMenu(hWnd,TheMenu);
while (GetMessage(&Msg, NULL,0,0))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return 0;
}
LRESULT CALLBACK MainWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch (message)
{
case WM_DESTROY:
PostQuitMessage(0);
// case WM_TOUCH:
// MessageBox(0,"TOUCH","touched",MB_OK);
case WM_GESTURE:
MessageBox(0,"GESTURE","touched",MB_OK);
case WM_COMMAND:
switch(wParam)
{
case 1: MessageBox(0,"MENU HIT Alpha","touched",MB_OK);
return (0);
case 3: MessageBox(0,"MENU HIT Gamma","touched&q |
|
Back to top |
|
 |
FLEXPLAN3D
Joined: 25 Feb 2011 Posts: 27
|
Posted: Tue Jan 14, 2014 4:39 pm Post subject: |
|
|
The windows procedure got truncated imn my last reply - Here is what it should be.
LRESULT CALLBACK MainWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch (message)
{
case WM_DESTROY:
PostQuitMessage(0);
// case WM_TOUCH:
// MessageBox(0,"TOUCH","touched",MB_OK);
case WM_GESTURE:
MessageBox(0,"GESTURE","touched",MB_OK);
case WM_COMMAND:
switch(wParam)
{
case 1: MessageBox(0,"MENU HIT Alpha","touched",MB_OK);
return (0);
case 3: MessageBox(0,"MENU HIT Gamma","touched",MB_OK);
return (0);
case 21: MessageBox(0,"MENU HIT Beta1","touched",MB_OK);
return (0);
case 22: MessageBox(0,"MENU HIT Beta2","touched",MB_OK);
return (0);
case 23: MessageBox(0,"MENU HIT Beta3","touched",MB_OK);
return (0);
}
default: return DefWindowProc(hWnd,message,wParam,lParam) ;
}
} |
|
Back to top |
|
 |
FLEXPLAN3D
Joined: 25 Feb 2011 Posts: 27
|
Posted: Tue Jan 14, 2014 6:15 pm Post subject: |
|
|
I have just tried one of the clearwin examples that comes with the compiler. It is Treeview.exe which I built using visual studio that comes with the latest version of FTN95 express.
It has a small menu which crashes the program when selected by touch or stylus. Ok with mouse.
The error message is a floating point stack fault |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Jan 14, 2014 9:12 pm Post subject: |
|
|
I am thinking that this could be a Microsoft Windows problem. Is there a way for you to test without using SCC or FTN95? |
|
Back to top |
|
 |
FLEXPLAN3D
Joined: 25 Feb 2011 Posts: 27
|
Posted: Wed Jan 15, 2014 6:24 pm Post subject: |
|
|
I have now downloaded a trial version of Visual Studio 2012.
I created a project using the same 'c++' code as in the listing above, and compiled and linked it with the Microsoft C++ compiler and linker.
The executable runs fine on the tablet.
The only changes needed were an additional include file
#include "stdafx.h"
and conversion of the 8bit ascii text to wide characters (16bit ISO code)
eg. wchar_t *Beta2 =L"Beta2" ; |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Fri Jan 17, 2014 9:10 am Post subject: |
|
|
I will see what can be done about this. I don't have access to a suitable device at the moment but I might be able to let you have a debug version of the dll. This, hopefully will provide you with a full trace back on failure. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Jan 23, 2014 10:23 am Post subject: |
|
|
I have created a debug version of salflibc.dll but this does not add anything to the trace back.
Two things...
1) Can you try using the latest beta version of salflibc.dll by downloading from http://www.silverfrost.com/beta/salflibc.exe.
2) If there is no improvement, can you post the trace back that you get on failure. |
|
Back to top |
|
 |
FLEXPLAN3D
Joined: 25 Feb 2011 Posts: 27
|
Posted: Thu Jan 23, 2014 5:53 pm Post subject: |
|
|
I have tried the beta salflibc.dll and the program still crashes.
I get a message box (call stack/status) - Invalid floating point operation
The trace back heading is *unknown* (in ninput.dll)
751588ee FSTP [EBF-0X10]
751588f1 TEST EC, 0x800
751588fd JE 75179BA9
etc....
Is there a better way of posting a traceback to you. I took a screenshot of the screen but could not see a way of attaching it to this post. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Feb 24, 2014 8:11 pm Post subject: |
|
|
This may not make any difference but your interface for MessageBox differs from that in win32api.ins. The REFs become INSTRINGs. |
|
Back to top |
|
 |
jalih
Joined: 30 Jul 2012 Posts: 196
|
Posted: Tue Feb 25, 2014 11:32 am Post subject: Re: |
|
|
FLEXPLAN3D wrote: | I get a message box (call stack/status) - Invalid floating point operation
The trace back heading is *unknown* (in ninput.dll)
751588ee FSTP [EBF-0X10]
751588f1 TEST EC, 0x800
751588fd JE 75179BA9
etc....
|
To me, it seems like the code inside the ninput.dll is causing a floating point exception and don't restore the floating point state before returning control to the user program.
Have you tried disabling (masking) the floating point exceptions before calling functions inside the dll? Also it may be possible that DLL_PROCESS_ATTACH handler is re-enabling the floating point exceptions, so you are out of luck. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Feb 25, 2014 5:02 pm Post subject: |
|
|
Jalih
Does your test program use the original sample but with a corrected interface for MessageBox? |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|