Silverfrost Forums

Welcome to our forums

Run-time Error: 00401000 main [+0080]

26 Jan 2011 12:50 #7630

In debug win32 mode the program works fine. When I start the release win32 version the following run-time error occurs. Using checkmate win32 and debugging the string used for the dynamic titlebar, the initial assignment for the caption does not work properly.

Runtime error from program:h:\ftn95\femag\bch\src\release\win32\bch.exe Run-time Error Unused arguments on winio call

00401000 main [+0080]

Question: Why does the program work with debug win32 and not in release/checkmate win32?

[URL=http://img843.imageshack.us/i/string.png/]http://img843.imageshack.us/img843/7813/string.png[/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL][/b]

27 Jan 2011 7:26 #7635

Has this just started happening? It seems a bit of fundamental problem - first line of program is incorrect.


-- Admin Silverfrost Limited
28 Jan 2011 8:00 #7638

The program is developed in Debug Win32 mode without any problems. Building it with Release Win32 the run-time errors occurs.

The variable TITLE_BAR_CAPTION is defined as character(len=50). With checkmate the assigment 'BCH-Reader' results in '??????????'.

Is the fundamantal error in the code or the compiler - it works in Debug Win32 mode.

28 Jan 2011 8:07 #7639

The variable TITLE_BAR_CAPTION is defined as character(len=50).

Well just post the actual code, this is not visible in the images you posted.

28 Jan 2011 8:54 #7640

Main and COMMON block: winapp program BCH implicit none include <windows.ins> character(len=256) :: cmd_line integer :: i,ctrl integer*2 :: INVOKED,CMNARGS@ ! COMMON BLOCKS include 'GUI_PARAMETER.INC' ! EXTERNAL EXTERNAL & & FN_CLR_WINDOW, & & FN_PRN_DATA, & & FN_OPERATING_POINT, & & select_file, & & about_box_cb

  title_bar_caption = 'BCH-Reader'
  INVOKED = CMNARGS@()
  ctrl = -1
  i=winio@('%ca@&',title_bar_caption)
  i=winio@('%ww&')
  i=winio@('%sy[thin_border]&')
  i=winio@('%bg[BTNFACE]%nl&')
  i=winio@('%mn[Open,About,Exit]&',               &
    &   select_file,                              &
    &   about_box_cb,                             &
    &   'EXIT')
  i=winio@('%mi[PRG_ICON]&')
  i=winio@('%ob[depressed,named_c][BCH Results]&')
  i=winio@('%80.20cw[vscroll]%cb&',0)
  i=winio@('%lw%ff%2nl&',ctrl)
  i=winio@('Torque %15rf&',T_AIRGAP)
  i=winio@('%tan/min %15rf&',N_RPM)
  i=winio@('%taUmax %15rf&',U_MAX)
  i=winio@('%ta%`^bt[Calculate]%2nl&',FN_OPERATING_POINT)
  i=winio@('%^bt[Clear]&',FN_CLR_WINDOW)
  i=winio@('%ta%^bt[Show arrays]',FN_PRN_DATA)
  if (INVOKED>=1) then
    CALL GET_COMMAND_ARGUMENT(1,cmd_line)
    write(*,*) 'Command line argument = '//trim(cmd_line)
  endif
end

  double precision :: T_airgap = 0.0D0,     &
      &               n_rpm = 0.0D0,        &
      &               U_max = 0.0D0
  character(len=50) :: title_bar_caption

  common /GUI_PARAMETER/                                &
      & T_airgap,n_rpm,U_max,title_bar_caption
28 Jan 2011 10:20 #7641

Works fine here, in the debugger the string is correctly displayed in /debug and in /full_debug/checkmate and all compiles run till the winio menu call which lacks the callback functions.

28 Jan 2011 10:57 #7642

Sebastian, thanks for checking! It is good that know that it works. Strange, on my machine I get a run-time error when I switch to Release or Checkmate.

I took out all the functions and subroutines and put them in a separate file. The main part contains now only the winapp followed by the resources. Seems like the compiler does not like code between winapp and the resources.

Anyway, it works now.

Please login to reply.