1. Going Back to 2000! with Yuku's aku.e
- Posted by euphoric (admin) Feb 23, 2023
- 854 views
Wow!
So, I have written a library called debug_printing.e (yes, this was before @GHaberek's implementation of such functionality, which I should look into because he does programming way better than me--but I digress), and I was having an issue in my source with the dp() ("debug_print") call suddenly not working. I have been confused about this for months... maybe years.
Anyway, today I sat down to really consider what was going on (because I really needed to), and after a ton of dp() calls all over the place, I finally found the culprit of why the debug printing stopped working after a while.
Inside @Yuku's aku.e, there is this code:
global object pppath if platform() = 3 then pppath = '/' else pppath = '\\' end if -------- 23 -- hapus console yang ga perlu!!! object hapuscon_kernel32, hapuscon_freeconsole, hapuscon_tp if platform() = 2 then hapuscon_kernel32 = open_dll("kernel32.dll") hapuscon_freeconsole = define_c_func(hapuscon_kernel32, "FreeConsole", {}, C_LONG) hapuscon_tp = c_func(hapuscon_freeconsole, {}) end if
I whittled it down with this ridiculousness:
-- Standard Library ... by Aku 2000-2003 include debug_printing.e dp("here inside aku.e") include graphics.e include get.e include machine.e include dll.e include wildcard.e include file.e dp("here inside aku.e past includes") dp("aku 1") object tp, tp2 global object pppath if platform() = 3 then pppath = '/' else pppath = '\\' end if -------- 23 -- hapus console yang ga perlu!!! object hapuscon_kernel32, hapuscon_freeconsole, hapuscon_tp dp("aku 2") if platform() = 2 then dp("aku 3") hapuscon_kernel32 = open_dll("kernel32.dll") dp("aku 4") hapuscon_freeconsole = define_c_func(hapuscon_kernel32, "FreeConsole", {}, C_LONG) dp("aku 5") hapuscon_tp = c_func(hapuscon_freeconsole, {}) dp("aku 6") end if dp("aku 7")
Can anybody guess where it was stopping? I'll wait a minute...
OK! The last dp() printed was "aku 5"!
Gol dern it! @Yuku was disabling console printing!
So, my question is... Why?
I've simply commented out that line, so it no longer cancels my console printing.
I'm also impressed that it's 2023 and I'm still using a 20-year-old library.
2. Re: Going Back to 2000! with Yuku's aku.e
- Posted by ghaberek (admin) Feb 23, 2023
- 841 views
It would seem that calling the FreeConsole function does exactly as described and, ya know, detaches the calling process from its console.
-Greg
3. Re: Going Back to 2000! with Yuku's aku.e
- Posted by euphoric (admin) Feb 23, 2023
- 842 views
It would seem that calling the FreeConsole function does exactly as described and, ya know, detaches the calling process from its console.
Yes yes yes.
But WHY was it included there, I wonder.
For me, it was a beeeotch figuring this out. I still have hair left, but barely.
4. Re: Going Back to 2000! with Yuku's aku.e
- Posted by axtens_bruce Feb 23, 2023
- 819 views
Just for background see microsoft documentation and other documentation
5. Re: Going Back to 2000! with Yuku's aku.e
- Posted by petelomax Feb 23, 2023
- 838 views
But WHY was it included there, I wonder.
Back then, exw.exe was for gui apps and exwc.exe for console use, iirc.
It would actually make the console disappear, and hence made more sense on exw.exe
Google translate, btw, gives me "delete the unnecessary console" for "hapus console yang ga perlu"