replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - WINDOWS 8.1 and Microsoft Surface Pro Tablet
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WINDOWS 8.1 and Microsoft Surface Pro Tablet
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
FLEXPLAN3D



Joined: 25 Feb 2011
Posts: 27

PostPosted: Mon Jan 13, 2014 1:02 pm    Post subject: WINDOWS 8.1 and Microsoft Surface Pro Tablet Reply with quote

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
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Mon Jan 13, 2014 6:32 pm    Post subject: Reply with quote

Are you using the latest release of FTN95?
Back to top
View user's profile Send private message AIM Address
FLEXPLAN3D



Joined: 25 Feb 2011
Posts: 27

PostPosted: Mon Jan 13, 2014 7:07 pm    Post subject: Reply with quote

Paul

I have downloaded personal editions of both FTN95 (V7.00.0) and FTN95 express for this test.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Tue Jan 14, 2014 9:31 am    Post subject: Reply with quote

Does a simple Fortran, program Work?
Back to top
View user's profile Send private message AIM Address
FLEXPLAN3D



Joined: 25 Feb 2011
Posts: 27

PostPosted: Tue Jan 14, 2014 4:36 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
FLEXPLAN3D



Joined: 25 Feb 2011
Posts: 27

PostPosted: Tue Jan 14, 2014 4:39 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
FLEXPLAN3D



Joined: 25 Feb 2011
Posts: 27

PostPosted: Tue Jan 14, 2014 6:15 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Tue Jan 14, 2014 9:12 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
FLEXPLAN3D



Joined: 25 Feb 2011
Posts: 27

PostPosted: Wed Jan 15, 2014 6:24 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Fri Jan 17, 2014 9:10 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Thu Jan 23, 2014 10:23 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
FLEXPLAN3D



Joined: 25 Feb 2011
Posts: 27

PostPosted: Thu Jan 23, 2014 5:53 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Mon Feb 24, 2014 8:11 pm    Post subject: Reply with quote

This may not make any difference but your interface for MessageBox differs from that in win32api.ins. The REFs become INSTRINGs.
Back to top
View user's profile Send private message AIM Address
jalih



Joined: 30 Jul 2012
Posts: 196

PostPosted: Tue Feb 25, 2014 11:32 am    Post subject: Re: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Tue Feb 25, 2014 5:02 pm    Post subject: Reply with quote

Jalih

Does your test program use the original sample but with a corrected interface for MessageBox?
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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