Get windows Runtime Error at starting my application

Hi everybody,

a user gets the following Windows runtime error message when starting the compiled program.

The system environment is:

  • Lenovo ThinkPad, W520, i7, SSD, 8 GB Ram,

  • Windows 10 Prof 64 bit, Version 1709, System Build 16299.192

The application is built as 32 bit application using Xojo 2017r1.1 and runs on a lot of installations

without any problems.

We also tested a 64 bit compilation which runs with others users too without problems.

Both versions do not run with this user and result immediately after doubleclick on program

icon in the this runtime error:

Any hints are highly apreciated – thank you

Likely an out of memory situation unfortunately. To reduce memory usage I’d suggest creating/using alpha channel supported Pictures if you’re not already.

The application use 22MB (Activity Monitor on Mac OS). On startup the program has not loadet any user data.
Seams not t be the problem.

Check the graphics display driver is up to date.

I have updated the graphics drivers to the very newest version - problem and runtime error message is still the same

Run a dxdiag and see if there are any obvious problems.

What is the listed Memory and DirectX version at the bottom of the first screen?

On the Display tab(s) what are the state of the features in the features section?

Memory 8192 MB RAM
DirectX 12
on display tab it reports that all 3 DirectX features are avtivated
dxdiag reports no problems on all 3 pages (I could post the result DxDiag.txt file on request)

What are you doing when starting the app? Can you pinpoint this with a bit more detail? Like showing something in a canvas, an icon, something?

@Beatrix Willius: I am just the user of the application - we have to wait for info from Stefan Mettenbrink, the programmer.

I have no problem here, so I can’t say anything about it.
So far as I know, the user doubble klick the program icon and get the error message. That’s what I have seen with TeamViewer.
It’s the same with the 32-bit and 64-bit version.
I have no other user with this problem. Heiner can use the program on an other computer without problems.

Where can I help do to point it out?

@Heiner: Have you try to run it on an new user?

The only things I can think of are

Trying another directx program on his computer
Send him a fresh blank exe from xojo from a new project
Installing xojo and running it to see if it works
Does your app do anything at all in app.open?

Duplicate the project, and make a ‘debugging build’ with logging code.

Every few lines add ‘Currently doing ’

Hopefully, some of these lines will execute before that message appears and the program dies.
Examine the log and you will see where the code reached before dying. IT may point to the cause first time.
If not, add extra debugging lines just after the last line which worked until you track down the exact line that fails.
And then if you don’t know why, post the code from the general area that fails, here, including the definition of any variables which are used there.

Sadly, I think its likely to occur before your code begins, when Xojo starts to allocate memory for the display.
Try turning off double buffering.
Check the multi-res bitmaps you have provided are all present

In the OpenEvent I prepare some global Timer, load preferenses, set something on the main window (Ausgabefenster) …
You can see it below.

I have a subroutine, to write notifications in a file (all properties with “Fehlerprotokoll” , “Fehler=” mark the reached code). So I can write the reached steps in this file, to figure out, where the trouble starts.

OpenEvent:

[code]dim i,fehler,x,y as integer
dim s,t,n as String
dim f as folderItem
dim Preferencesvorhanden,merkeKonfession, GoOut as Boolean
dim datum as date
GlobalTimer = new timer
GlobalTimer.Period = 0
AddHandler GlobalTimer.action, AddressOf ShowErrorMessage
GlobalTimer.Mode = timer.ModeOff

GlobalHinweisTimer = new timer
GlobalHinweisTimer.Period = 0
AddHandler GlobalHinweisTimer.action, AddressOf ShowHinweis
GlobalHinweisTimer.Mode = timer.ModeOff

GlobalMessageDialogTimer = new timer
GlobalMessageDialogTimer.Period = 0
AddHandler GlobalMessageDialogTimer.action, AddressOf ShowMessageDialog
GlobalMessageDialogTimer.Mode = timer.ModeOff

GlobalSelectFolderTimer = new timer
GlobalSelectFolderTimer.Period = 0
AddHandler GlobalSelectFolderTimer.action, AddressOf ThreadSelectFolderDialog
GlobalSelectFolderTimer.Mode = timer.ModeOff

GlobalRefreshTimer = new timer
GlobalRefreshTimer.Period = 0
AddHandler GlobalRefreshTimer.action, AddressOf GlobalRefresh
GlobalRefreshTimer.Mode = timer.ModeOff

HilfsfensterTimer= new Timer
HilfsfensterTimer.Period=500
HilfsfensterTimer.Mode=Timer.ModeMultiple
AddHandler HilfsfensterTimer.action, AddressOf HilfsfensterAusblenden

kekulezuindexN=new Dictionary
MenuClipboard=new Clipboard
WorkingPath=SpecialFolder.Desktop
'CB=new Clipboard

if GoOut=false then
FehlerprotokollAktuelleMethode.append str(ticks-LastProgTicks)+" Application Open"

LastProgTicks=Ticks
fehler=1

Plugin//mbs plugin registration

fehler=2

programmstart=true//damit noch kein Datensatzrefresh gemacht wird
fehler=3

Base64//zum initialisieren der Decodingtabelle
//Mehrzeilige Texte definieren

LanguagePropertiesDeclaration

AllgemeinesSichern=MenuSpeichernWin
AllgemeinesSichern1=MenuSpeichernAlsWin
MenuDateiSichern=MenuSpeichernWin
MenuDateiSichernAls=MenuSpeichernAlsWin

Butlerinitialisierung=new ButlerInit

startposition=1
fehler=4
submitter.append new submitterclass
fehler=5
if Submitter(0)=nil then
FehlerprotokollAktuelleMethode.append str(ticks-LastProgTicks)+" *** Applikation/Open: Submitterdatensatz(0)=Nil ***"
end
fehler=6

f=getFolderItem("")
fehler=11
If f<>nil then
startpfad=f.AbsolutePath
end
fehler=12

Vorgabensetzen//set properties

fehler=20
BevelMenu.append “1”
BevelMenu.append “2”
BevelMenu.append “3”
BevelMenu.append “4”
BevelMenu.append “5”
BevelMenu.append “6”
BevelMenu.append “7”
BevelMenu.append “8”
BevelMenu.append “9”
BevelMenu.append “41”
BevelMenu.append “10”
BevelMenu.append “11”
BevelMenu.append “12”
BevelMenu.append “13”
BevelMenu.append “14”
BevelMenu.append “15”
BevelMenu.append “16”
BevelMenu.append “17”
BevelMenu.append “18”
BevelMenu.append “19”
BevelMenu.append “20”
BevelMenu.append “21”
BevelMenu.append “22”
BevelMenu.append “23”
BevelMenu.append “24”
BevelMenu.append “25”
BevelMenu.append “26”
BevelMenu.append “27”
BevelMenu.append “28”
BevelMenu.append “29”
BevelMenu.append “30”
BevelMenu.append “31”
BevelMenu.append “32”
BevelMenu.append “33”
BevelMenu.append “34”
BevelMenu.append “42”
BevelMenu.append “43”
BevelMenu.append “35”
BevelMenu.append “36”
BevelMenu.append “37”
BevelMenu.append “38”
BevelMenu.append “39”
BevelMenu.append “40”
BevelMenu.append “44”

fehler=21
Preferencesvorhanden=Preferencesladen//load preferences
LanguagePropertiesLaden("<"+AktuelleSprache+">")//nil=keine Datei übergeben
SetGedcomDateTranslations
fehler=22

s=GroupBoxWidths
if TargetWindows then
fehler=23
Ausgabefenster.GroupBox1.Width=val(NthField(s,",",1))
Ausgabefenster.GroupBox2.Width=val(NthField(s,",",2))
Ausgabefenster.GroupBox3.Width=val(NthField(s,",",3))

Ausgabefenster.GroupBox2.left=35+Ausgabefenster.GroupBox1.Width

Ausgabefenster.TabellenSeparator1(0).Left=Ausgabefenster.GroupBox1.Width+18
Ausgabefenster.TabellenSeparator1(1).Left=Ausgabefenster.GroupBox1.Width+22
Ausgabefenster.TabellenSeparator1(2).Left=Ausgabefenster.GroupBox1.Width+26

Ausgabefenster.GroupBox3.left=55+Ausgabefenster.GroupBox1.Width+Ausgabefenster.GroupBox2.Width

Ausgabefenster.TabellenSeparator1(3).Left=Ausgabefenster.GroupBox2.left+Ausgabefenster.GroupBox2.Width+3
Ausgabefenster.TabellenSeparator1(4).Left=Ausgabefenster.TabellenSeparator1(3).Left+4
Ausgabefenster.TabellenSeparator1(5).Left=Ausgabefenster.TabellenSeparator1(3).Left+8

Ausgabefenster.TabellenSeparator1(3).Visible=true
Ausgabefenster.TabellenSeparator1(4).Visible=true
Ausgabefenster.TabellenSeparator1(5).Visible=true

Ausgabefenster.ListBox1.Width=Ausgabefenster.GroupBox2.Width-18
Ausgabefenster.ListBox2.Width=Ausgabefenster.GroupBox1.Width-18
Ausgabefenster.ListBox3.Width=Ausgabefenster.GroupBox3.Width-18

end
fehler=24
GroupBoxWidths=s

for i=0 to 9// Die Bevelbuttons im Hauptfenster initialisieren (set some properties in the main window
fehler=25
Ausgabefenster.HauptfensterButton(i).Icon=IconSuchen(Ausgabefenster.HauptfensterButton(i),BevelMenu(HauptfensterButtonWert(i)))
Ausgabefenster.HauptfensterButton(i).ButtonType=0
if Ausgabefenster.HauptfensterButton(i).Icon=SchreibschutzOff or Ausgabefenster.HauptfensterButton(i).Icon=SchlossAuf then
Ausgabefenster.HauptfensterButton(i).ButtonType=1
end

fehler=26
if Ausgabefenster.HauptfensterButton(i).Icon=zurueck then
  fehler=27
  if Ausgabefenster.HistoryZeiger<=0 Then
    Ausgabefenster.HauptfensterButton(i).Enabled=False
    Ausgabefenster.HauptfensterButton(i).Icon=zurueckh
  else
    Ausgabefenster.HauptfensterButton(i).Enabled=true
    Ausgabefenster.HauptfensterButton(i).Icon=zurueck
  end
elseif Ausgabefenster.HauptfensterButton(i).Icon=vor then
  fehler=28
  if Ausgabefenster.HistoryZeiger<=0 Then
    Ausgabefenster.HauptfensterButton(i).Enabled=False
    Ausgabefenster.HauptfensterButton(i).Icon=vorh
  else
    Ausgabefenster.HauptfensterButton(i).Enabled=true
    Ausgabefenster.HauptfensterButton(i).Icon=vor
  end
else
  Ausgabefenster.HauptfensterButton(i).Enabled=true
end

next

fehler=29
Datum=new date
if Datum<>nil then
Datum.Year = 2017
Datum.Month = 10
Datum.Day = 31

s=Datum.ShortDate
if Left(s, 2) = "31" then
  DateFormat=0
ElseIf Left(s, 2) = "10" then
  DateFormat=1
ElseIf Left(s, 2) = "17" or Left(s, 4) = "2017" then
  DateFormat=2
End if

end

fehler=30
Datum=new date
if Datum<>nil then
fehler=31
Datum.TotalSeconds=val(“3.1415927e+9”)
fehler=32
if val(GetYearString(datum))>2000 then
Nachkommatrenner="."
else
Nachkommatrenner=","
end
else
Nachkommatrenner="."
end

fehler=33
Startbutler=ShowButler
ShowButler=false

fehler=7
#if TargetWindows
Pfadtrenner=""
Declare Function GetDoubleClickTime Lib “User32.DLL” () as Integer
doubleClickTime= GetDoubleClickTime()/16
#endif
fehler=8

#if TargetCarbon
#if TargetMachO
Declare Function GetDblTime Lib “Carbon” () as Integer
#else
Declare Function GetDblTime Lib “CarbonLib” () as Integer
#endif
#endif

#if TargetMacOS
Pfadtrenner=":"
doubleClickTime=30//GetDblTime
#endif

#if TargetLinux
Pfadtrenner="/"
doubleClickTime=30
#endif

fehler=9

mauszeiger(8)=app.mouseCursor
fehler=10

fehler=13
if ubound(person)=0 then//initialize first data set
redim person(0)
redim gleichgeschlechtlicheEhe(-1)
redim MehrfachEhe(-1)
redim Fruehgeburt(-1)
redim AltEhe(-1)
redim SpaeteBestattung(-1)
redim AltePersonen(-1)
redim EntbindungInHohemAlter(-1)
kekulezuindexN.clear
redim konfession(-1)
redim KonfessionsKuerzel(-1)
konfession.append AllgemeinesUnbekannt
KonfessionsKuerzel.append “?”

merkeKonfession=LetzteKonfession
LetzteKonfession=false
neuerDatensatz
LetzteKonfession=merkeKonfession
veraendert=false
person(ubound(person)).indexNummer=1
person(ubound(person)).kekuleNummer=1
kekulezuindexN.value(1)=1
kekulesoll=kekulezuindex(1)
aktuellePosition=1
aktuellePositionuebernehmen(aktuellePosition)
stammbaumdatei=nil

end
fehler=14
if aktuellePosition=0 then
kekulesoll=kekulezuindex(1)
aktuellePosition=1
end
fehler=15
if Preferencesvorhanden=false then
fehler=16

OpenInfoWindow=true
Sprachwahl.ShowModal

end
if AktuelleSprache="" then
Sprachwahl.ShowModal
end
if aktuelleLandesfahne<>nil then
Help_Menu.Icon=aktuelleLandesfahne
end

if bemerkungenfensteroffen=true then
bemerkungen.show
Bemerkungen.redraw
end

ShowButler=startbutler
PrefGeladen=true
'programmstart=false
FehlerprotokollAktuelleMethode.append str(ticks-LastProgTicks)+" Application Open (beendet)"
else
FehlerprotokollAktuelleMethode.append str(ticks-LastProgTicks)+" Beenden von FB, weil unter Linux libWebKit fehlt"
quit
end

Exception err
Fehlerbehandlung(err.message,“Applikation/Open Fehlerstelle: “+str(fehler),””,false)…[/code]

So, does any logging happen?
I would add a lot more if so.

This app.Open event seems to set the properties of windows… the window may not be initialised properly when you do this.
You appear to be using Ausgabefenster as an implicit instantiation window, and assuming it is ‘always present’?
Then amending properties of the controls

Ausgabefenster.GroupBox2.left = etc

Take all the Ausgabefenster code and put it into the Activate event of Ausgabefenster
To make sure it only happens once, you can use a static variable:

[quote]static bActivated as boolean
if not bActivated then

//set up the controls
bActivated = true
end if
[/quote]

Im not sure what this is for:

AddHandler GlobalSelectFolderTimer.action, AddressOf ThreadSelectFolderDialog

Why would you show select folders in a timer?
You definitely shouldnt in a thread… but I dont know what your intention is here.

@ Jeff Tullin:
That is new for me.

How can I do that? I need a program, that runs stand allone on the users computer.

Thats my thougts, too

How?

All works fine on many other computers

Yes.
Copy the code and add new lines of debugging to the code.
Build it and send this version to this customer.
I say ‘copy the code’ because unless you use #defines around the logging code, you would be making the ‘real’ app that everyone gets , bigger in size.

Check the properties of windows and controls in the IDE

We know. That doesnt make much difference to me…

I work on the basis that if something fails on any computer, it is going to fail on some others.
When this kind of thing happens to me, my worry is that the other people who are having trouble have simply not told me.

If you debug using:

System.DebugLog("HelloWorld")

You can use DebugView to see the logging and you don’t need to concern yourself with writing to a file that you may not write to or close correctly due to a crash.

[quote]Duplicate the project, and make a ‘debugging build’ with logging code.
Every few lines add 'Currently doing ’
[/quote]

… I need som time to get it. I searched for an debugging option.

[quote]So, does any logging happen?
I would add a lot more if so.[/quote]

Yes, but in local propertie and will store in an ErrorEvent. So I have to change it to save immediately. Thats what you mean above, I think.

[quote]Take all the Ausgabefenster code and put it into the Activate event of Ausgabefenster
To make sure it only happens once, you can use a static variable:[/quote]

Well, I think I can move the code to the OpenEvent of the window. I will test it.

[quote]
Im not sure what this is for:
AddHandler GlobalSelectFolderTimer.action, AddressOf ThreadSelectFolderDialog[/quote]

Me too :slight_smile:
I think its from the coding arround differences between REALStudio 2010 and Xojo 2016, to get the old code work on xojo.

@Stefan Mettenbrink: to your question very above: yes I created a new user on my pc but with this the result was the same. So I deletd it again.
Another idea: if there is a trial version of the IDE Xojo I could install on my computer and you could debug your code using Teamviewer? Maybe this is easier than writing so many debug extensions to your original code?

In any case: let me say a very big thank you to all people helping here !!!

If you want to try running an empty project you can download Xojo for free from here:

https://www.xojo.com/download/

Install it, run it, type in test into the name of the desktop project and hit the big green run button is the middle at the top and see.