Search
Tuesday, 17th of September 2019, 15:19:32 UTC
18:33:22
asdf_asdf_asdf
LRESULT CALLBACK WindowProc(_In_ HWND hwnd,_In_ UINT uMsg,_In_ WPARAM wParam,_In_ LPARAM lParam);
18:33:32
asdf_asdf_asdf
Hi. How it implement in SBCL (Common Lisp) without body?
18:33:59
asdf_asdf_asdf
I use sb-alien::define-alien-callback, but it require put a &body.
18:34:28
stassats
and what do you have against bodies?
18:35:45
asdf_asdf_asdf
First have be signature as callback. Second callback have be with body.
18:36:27
stassats
of what use is a callback if it doesn't do anything?
18:37:03
asdf_asdf_asdf
https://docs.microsoft.com/en-us/windows/win32/learnwin32/your-first-windows-program Here is an example.
18:37:18
stassats
that's c, lisp is not c
18:42:42
stassats
so, you just need one define-alien-callback
18:43:11
asdf_asdf_asdf
OK. I have two warnings: Undefined alien: "GetMessage", Undefined alien: "DispatchMessage".
18:43:48
asdf_asdf_asdf
(load "file.fasl")
18:45:37
stassats
can you try DispatchMessageA instead?
18:46:44
stassats
(same with GetMessageA)
18:47:30
asdf_asdf_asdf
Thanks. It works. I did is, but I must turn off sbcl and turn again.
18:48:19
stassats
do not the warning? oh yeah, that's persistent
18:48:40
stassats
but you can disregard it if you know it's fixed
18:50:15
asdf_asdf_asdf
Window is not showed. I implement function WinMain inside a defun function - is it correct?
18:50:51
stassats
post the code somewhere?
18:53:13
asdf_asdf_asdf
https://cpy.pt/6Gdu7ZZ3 Your work and my.
18:54:49
stassats
are you calling WinMain?
18:57:47
stassats
gotta call that yourself, as, again, this is not c
19:32:10
asdf_asdf_asdf
(OR NULL SB-SYS:SYSTEM-AREA-POINTER (SB-ALIEN:ALIEN (* T)))
19:32:14
asdf_asdf_asdf
What is it for type?
21:13:25
asdf_asdf_asdf
Hi. My code compile all, but window isn't created.
22:52:00
asdf_asdf_asdf
Hi. My Window in Windows not created, why?
22:52:26
stassats
probably because the code is wrong
22:53:22
asdf_asdf_asdf
Paste this code?
22:53:51
stassats
you can, but it probably won't be evident
22:54:56
asdf_asdf_asdf
https://cpy.pt/EQNekDUP
22:56:25
stassats
i'd get 0, but 1 is less clear
22:57:05
stassats
an (make-alien int 1), is that's what CreateWindowExA is expecting?
23:08:42
asdf_asdf_asdf
https://lispcookbook.github.io/cl-cookbook/win32.html How get handle?
23:31:44
stassats
you can use (sb-win32:format-system-message (sb-win32:get-last-error)) to get the errors produced by the win32 functions
23:32:49
asdf_asdf_asdf
Very thanks. I must get "hThisInstance".
23:33:02
asdf_asdf_asdf
(WinMain (make-alien int 0) 1 1 1)
0:06:12
stassats
asdf_asdf_asdf: https://cpy.pt/1Ns7uf98
0:06:39
stassats
your tagWNDCLASSA struct wasn't correctly defined, and it also need to be zero initialized
0:06:59
stassats
and for some reason #x400000 works as hinstance
0:14:48
asdf_asdf_asdf
@stassats; I don't have window.
0:16:33
stassats
are you using 32-bit sbcl?
0:16:36
asdf_asdf_asdf
Hang cursor "Infinite loop".
0:17:23
stassats
just check the return value of all the win32 functions and get the errors with (sb-win32:format-system-message (sb-win32:get-last-error))
0:18:02
stassats
a cursor is already something
0:20:05
asdf_asdf_asdf
I can't found specify file - error.
0:38:27
stassats
i changed the tagWNDCLASSA struct for x86-64
0:39:04
stassats
in lieu of finding the correct definition, just getting the right offsets
0:40:09
stassats
change them to (* t) from long-long, and replace the 0s with NILs
0:41:21
asdf_asdf_asdf
https://cpy.pt/wQZhq9eK
0:41:38
asdf_asdf_asdf
Your code is for architecture x64?
0:41:45
asdf_asdf_asdf
My SBCL is x86.
0:42:16
stassats
replace unsigned-long-long with (* t)
0:46:09
stassats
asdf_asdf_asdf: https://cpy.pt/NtxFeF31
0:51:21
asdf_asdf_asdf
stassats; very, very thank You for help. It works.
0:51:54
asdf_asdf_asdf
But in inferior-lisp not works, only in console Windows.
0:53:32
asdf_asdf_asdf
Why in inferior-lisp, it catching I/O in Windows?
1:02:01
asdf_asdf_asdf
Thank You, again.
Wednesday, 18th of September 2019, 3:19:32 UTC