Hard crash when using declares (adapted for 64bit)

I adapted a small project with declares to 64bit
This should work fine but it hard crashes for some reason.

Project included in the feedback case

<https://xojo.com/issue/39482>

Process: BlackWindow [918]
Path: /Users/USER/Desktop/*/BlackWindow.app/Contents/MacOS/BlackWindow
Identifier: com.black.window
Version: BlackWindow (1.0.0.0.0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: BlackWindow [918]
User ID: 501

Date/Time: 2015-05-27 09:06:32.705 +0200
OS Version: Mac OS X 10.10.3 (14D136)
Report Version: 11
Anonymous UUID: 1E134FC9-3008-DB14-DEF8-C4BB92A57BA1

Time Awake Since Boot: 3500 seconds

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000018

VM Regions Near 0x18:

__TEXT 0000000106b1b000-0000000106c26000 [ 1068K] r-x/rwx SM=COW /Users/USER/Desktop/*/BlackWindow.app/Contents/MacOS/BlackWindow

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fff8befb825 objc_msgSend_stret + 37
1 com.black.window 0x0000000106befd7b BlackWindowTitleBar.Event_Open%%o + 779 (64_BlackWindowTitleBar:87)
2 com.xojo.XojoFramework 0x0000000106eacac5 FireWindowOpenEvents + 53
3 com.black.window 0x0000000106b26512 Window.Constructor%%o + 50 (64_#rbframework:6593)
4 com.black.window 0x0000000106be42d4 Window1.Window1%o<Window1.Window1>% + 260 (64_Window1:79)
5 com.black.window 0x0000000106b1c230 MakeDefaultView + 48 (64__main:51)
6 com.black.window 0x0000000106b1c34d LateStartup + 29 (64__main:71)
7 com.black.window 0x0000000106bc365a Delegate.Invoke%%p + 10 (64_#rbframework:3)
8 com.black.window 0x0000000106bbbbb9 REALbasic.CallFunctionWithExceptionHandling%o%pp + 201 (64#rbframework:71831)
9 com.xojo.XojoFramework 0x0000000106e27e6f 0x106d06000 + 1187439
10 com.xojo.XojoFramework 0x0000000106d41738 0x106d06000 + 243512
11 com.xojo.XojoFramework 0x0000000106d4035c 0x106d06000 + 238428
12 com.apple.CoreFoundation 0x00007fff8eac945c CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 12
13 com.apple.CoreFoundation 0x00007fff8e9b9634 _CFXNotificationPost + 3140
14 com.apple.Foundation 0x00007fff88a729d1 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
15 com.apple.AppKit 0x00007fff86e9ab9b -[NSApplication _postDidFinishNotification] + 291
16 com.apple.AppKit 0x00007fff86e9a906 -[NSApplication sendFinishLaunchingNotification] + 191
17 com.apple.AppKit 0x00007fff86e90f92 DPSNextEvent + 2473
18 com.apple.AppKit 0x00007fff86e8ff68 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
19 com.xojo.XojoFramework 0x0000000106d41e5a 0x106d06000 + 245338
20 com.xojo.XojoFramework 0x0000000106d41e9e 0x106d06000 + 245406
21 com.black.window 0x0000000106b1c5b6 Delegate.Invoke%% + 22 (64__main
:77)
22 com.black.window 0x0000000106b58028 Application.CallFunctionWithExceptionHandling%%op + 216 (64#rbframework:22975)
23 com.xojo.XojoFramework 0x0000000106e9a8e2 0x106d06000 + 1657058
24 com.xojo.XojoFramework 0x0000000106d41df7 0x106d06000 + 245239
25 com.apple.AppKit 0x00007fff86e85bf3 -[NSApplication run] + 594
26 com.xojo.XojoFramework 0x0000000106e98ceb RuntimeRun + 44
27 com.black.window 0x0000000106bbbe36 REALbasic.RuntimeRun + 6 (64#rbframework:72003)
28 com.black.window 0x0000000106b1c4d9 Main + 329 (64__main:78)
29 com.black.window 0x0000000106b1bf83 main + 19 (64__main
:83)
30 com.black.window 0x0000000106b1bf64 start + 52

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x00007fff8cea9232 kevent64 + 10
1 libdispatch.dylib 0x00007fff8510da6a _dispatch_mgr_thread + 52

Thread 2:
0 libsystem_kernel.dylib 0x00007fff8cea894a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff88ec740d start_wqthread + 13

Thread 3:
0 libsystem_kernel.dylib 0x00007fff8cea894a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff88ec740d start_wqthread + 13

Thread 4:
0 libsystem_kernel.dylib 0x00007fff8cea894a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff88ec740d start_wqthread + 13

Thread 5:
0 libsystem_kernel.dylib 0x00007fff8cea894a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff88ec740d start_wqthread + 13

Thread 6:
0 libsystem_kernel.dylib 0x00007fff8cea894a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff88ec740d start_wqthread + 13

Thread 7:
0 libsystem_kernel.dylib 0x00007fff8cea894a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff88ec740d start_wqthread + 13

Thread 8:
0 libsystem_kernel.dylib 0x00007fff8cea894a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff88ec740d start_wqthread + 13

Thread 9:
0 libsystem_kernel.dylib 0x00007fff8cea894a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff88ec740d start_wqthread + 13

Thread 10:
0 libsystem_kernel.dylib 0x00007fff8cea894a __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff88ec740d start_wqthread + 13

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x00007fff831f2943 rbx: 0x0000000000000000 rcx: 0x0000000000040000 rdx: 0x00007fff8bf69b68
rdi: 0x0000608000133380 rsi: 0x00007fff831f2943 rbp: 0x0000608000133380 rsp: 0x00007fff590e3c18
r8: 0x0000000000000000 r9: 0x00000000000006b0 r10: 0x00007fff8bf69b68 r11: 0x0000000000000000
r12: 0x00000001070998d8 r13: 0x0000000000000000 r14: 0x00007ff901d1eff8 r15: 0x00006180001886e0
rip: 0x00007fff8befb825 rfl: 0x0000000000010206 cr2: 0x0000000000000018

Logical CPU: 2
Error Code: 0x00000004
Trap Number: 14

Binary Images:
0x106b1b000 - 0x106c25fff +com.black.window (BlackWindow - 1.0.0.0.0) <57E1D740-8781-3E1D-A790-5413CE0FEFFE> /Users/USER/Desktop//BlackWindow.app/Contents/MacOS/BlackWindow
0x106d06000 - 0x10704cff7 +com.xojo.XojoFramework (1.0 - 1) <52018EC2-46D8-3F2A-802C-E99049EA024E> /Users/USER/Desktop/
/BlackWindow.app/Contents/Frameworks/XojoFramework.framework/Versions/A/XojoFramework
0x10b5c0000 - 0x10b5c0fef +cl_kernels (???) <90831A77-0EA0-4D8A-B4D9-01AF9F433E82> cl_kernels
0x10b5ce000 - 0x10b5ceff5 +cl_kernels (???) cl_kernels
0x10b5d0000 - 0x10b6b6fef unorm8_bgra.dylib (2.4.5) <7BFE1DA8-2BE4-3B4F-8A7F-F3D6D4D36ADA> /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/ImageFormats/unorm8_bgra.dylib
0x7fff65c48000 - 0x7fff65c7e837 dyld (353.2.1) <65DCCB06-339C-3E25-9702-600A28291D0E> /usr/lib/dyld
0x7fff80831000 - 0x7fff80831fff com.apple.Carbon (154 - 157) <9BF51672-1684-3FDE-A561-FC59A2864EF8> /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x7fff80832000 - 0x7fff8086cffb com.apple.DebugSymbols (115 - 115) <6F03761D-7C3A-3C80-8031-AA1C1AD7C706> /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols
0x7fff80889000 - 0x7fff808a9fff com.apple.IconServices (47.1 - 47.1) /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices
0x7fff8096d000 - 0x7fff8096ffff com.apple.loginsupport (1.0 - 1) /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport
0x7fff80970000 - 0x7fff80978fff libsystem_dnssd.dylib (561.1.1) <62B70ECA-E40D-3C63-896E-7F00EC386DDB> /usr/lib/system/libsystem_dnssd.dylib
0x7fff80aff000 - 0x7fff80b0afff libGL.dylib (11.1.2) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x7fff80b0b000 - 0x7fff80b27ff7 libsystem_malloc.dylib (53.1.1) <19BCC257-5717-3502-A71F-95D65AFA861B> /usr/lib/system/libsystem_malloc.dylib
0x7fff8146e000 - 0x7fff81484ff7 libsystem_asl.dylib (267) /usr/lib/system/libsystem_asl.dylib
0x7fff81485000 - 0x7fff81569fff libcrypto.0.9.8.dylib (52.20.2) <977DA067-2588-3BF8-A7B2-F08FC6E9088F> /usr/lib/libcrypto.0.9.8.dylib
0x7fff81577000 - 0x7fff81580fff com.apple.DisplayServicesFW (2.9 - 372.1) <30E61754-D83C-330A-AE60-533F27BEBFF5> /System/Library/PrivateFrameworks/DisplayServices.framework/Versions/A/DisplayServices
0x7fff81581000 - 0x7fff815a2fff com.apple.framework.Apple80211 (10.3 - 1030.71.6) /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211
0x7fff815b0000 - 0x7fff815b2fff com.apple.EFILogin (2.0 - 2) <3BA837D8-94F5-3240-9CF7-E40DC2808446> /System/Library/PrivateFrameworks/EFILogin.framework/Versions/A/EFILogin
0x7fff815b3000 - 0x7fff816edfff com.apple.ImageIO.framework (3.3.0 - 1237) <3C06213D-847A-3C7B-843E-6EC37113965D> /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x7fff816ee000 - 0x7fff816f9ff7 libkxld.dylib (2782.20.48) <28EF8328-E3E2-336A-974B-FB1BF119D55A> /usr/lib/system/libkxld.dylib
0x7fff816fb000 - 0x7fff81703fe7 libcldcpuengine.dylib (2.4.5) <0E9B5292-1EBC-379D-A706-83A27C05D742> /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libcldcpuengine.dylib
0x7fff81704000 - 0x7fff81711ff7 com.apple.SpeechRecognitionCore (2.1.2 - 2.1.2) <551322E2-C1E4-3378-A218-F362985E3E3C>

You cannot declare into a 64-bit library from a 32-bit program.