Page 3 of 103

Posted: Fri Feb 10, 2006 4:30 pm
by ts-soft
gnozal wrote:Update

- added /UNICODE compiler switch
I have test it, doesn't work :?

Posted: Fri Feb 10, 2006 4:35 pm
by gnozal
ts-soft wrote:
gnozal wrote:Update
- added /UNICODE compiler switch
I have test it, doesn't work :?
How do you test ?
All I notice is that the executable's size is different : 3584 bytes with /UNICODE and 3072 bytes without. I don't know how or what to test. I am still using Win98 ...
Is there more to do than just adding the switch at compile time ? I don't know...

Posted: Fri Feb 10, 2006 4:52 pm
by ts-soft
I habe test an source with only in unicode run's. with the normal ide and unicode support + utf8 it's run. with japbe with Unicode - UTF8 (65001) and Unicode-Support, no Function, also as exe.

The Testsource are here: viewtopic.php?t=19296

Posted: Fri Feb 10, 2006 5:01 pm
by gnozal
Thanks.
Seems to be for XP only ... Can't use it.

Anyway, does someone know the requirements to compile a unicode executable without the official IDE ? Is it possible ?

Posted: Fri Feb 10, 2006 5:08 pm
by Dare2
Must be, for command line compiling. Surely? I thought it was just sending /UNICODE in the program parameters.

But I know zip about unicode.

Where's Xombie!? Help!

Posted: Sat Feb 11, 2006 8:46 am
by gnozal
Ok, I found the problem with the new compiler options. I should have read the jaPBe sources more carefully ...
- jaPBe calls PBCompiler.exe directly only in 'Compile Manually' mode, so "/UNICODE" should work in this mode
- else (Compile/Run or CreateEXE), jaPBe uses PostThreadMessage() to communicate with the compiler

Code: Select all

PostThreadMessage_(CompilerThreadID, PB_MSG_ID, #PB_MSG_Start_Compilation, flags)
so the problem is : what are the flags for /THREAD and UNICODE ? And what are the other changes ?
I think I found the /THREAD flag value, but not the /UNICODE ...

Code: Select all

;
; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
; Compiler flags
#PB_FLG_INLINEASM     = 1
#PB_FLG_ENABLENT4     = 1 << 1   ; still ok ?
#PB_FLG_DEBUGGER      = 1 << 2
#PB_FLG_CONSOLE       = 1 << 3
#PB_FLG_DLL           = 1 << 4
#PB_FLG_ENABLEXP      = 1 << 5
#PB_FLG_CPU_MMX       = 1 << 6
#PB_FLG_CPU_3DNOW     = 1 << 7
#PB_FLG_CPU_SSE       = 1 << 8
#PB_FLG_CPU_SSE2      = 1 << 9
#PB_FLG_CPU_DYNAMIC   = 1 << 10
#PB_FLG_ENABLEONERROR = 1 << 11
;
; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;
; ////////////// what are the compiler flags for /THREAD and /UNICODE ?
;
#PB_FLG_THREADSAFE    = 1 << 13 seems ok, the EXE imports Tls functions (TlsAlloc ...)
#PB_FLG_UNICODE       = 1 << X ?
;
; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Could someone from the PB team help us with this undocumented PostThreadMessage_() stuff ?

PS : I have uploaded a new version : the threadsafe option should now work (TLS functions imported by the EXE).

Posted: Sat Feb 11, 2006 1:33 pm
by freak
I will do a more complete info later, but this should help for now:

You are correct about the Thread flag.

The EnableNT4 flag has no effect anymore, you have to use /SUBSYSTEM NT4 (see below)

For Unicode and Subsystem, there is no flag to change this while the compiler is running.
(the compiler has to know the mode when it is started)

So you have to include the /UNICODE and /SUBSYSTEM parameters in the call
that starts the compiler, and whenever the setting changes, you have to kill
and restart the compiler with the needed flags set.

Posted: Mon Feb 13, 2006 8:11 am
by mipooh
Thanks for continuing JaPBe, I always liked it.

Posted: Mon Feb 13, 2006 8:54 am
by gnozal
freak wrote:I will do a more complete info later, but this should help for now:

You are correct about the Thread flag.

The EnableNT4 flag has no effect anymore, you have to use /SUBSYSTEM NT4 (see below)

For Unicode and Subsystem, there is no flag to change this while the compiler is running.
(the compiler has to know the mode when it is started)

So you have to include the /UNICODE and /SUBSYSTEM parameters in the call
that starts the compiler, and whenever the setting changes, you have to kill
and restart the compiler with the needed flags set.
Thank you very much for the information , Freak :D

Posted: Mon Feb 13, 2006 12:41 pm
by gnozal
Update

Changes :
- compiler restarts if NT4 and/or UNICODE flag has changed.

Could someone test the unicode stuff ? It seems to work as my little test executable now calls MessageBoxW and not MessageBoxA.

Posted: Mon Feb 13, 2006 2:28 pm
by Xombie
Sorry for not posting again but I was in China for a while there.

I've tested the Unicode option (Thank you!) but it doesn't work yet. The program is compiled but it doesn't seem like it's actually having an effect. Manually compiling with this option

Code: Select all

pbcompiler main.pb /UNICODE /EXE "main.exe"
does work. Hope that helps and thanks a lot for updating japbe!

Now that I'm back, I look forward to finally being able to post my main project (couldn't while pb4 was alpha) and contributing some more!

Posted: Mon Feb 13, 2006 2:44 pm
by ts-soft
I have test it, with Codepage Unicode/UTF8 and Unicode-Support, it's run good, in jaPBe and as exe also

Posted: Mon Feb 13, 2006 2:57 pm
by gnozal
Xombie wrote:I've tested the Unicode option (Thank you!) but it doesn't work yet.
Hmm, it seems to work for ts-soft.
Did you change the code page in jaPBe to Unicode/UTF8 in Files\Preferences\CodePage and enabled Unicode support in Project\Project Options\General\Unicode executable ?

Posted: Mon Feb 13, 2006 3:01 pm
by Xombie
Yeah. But let me amend that. If I do "Create Executable" then yes, it works just great. But if I hit the Compile/Run or Compile/Debug buttons, then no, it does not seem to notice the /Unicode option. Is that by design?

Posted: Mon Feb 13, 2006 3:08 pm
by gnozal
Xombie wrote:Yeah. But let me amend that. If I do "Create Executable" then yes, it works just great. But if I hit the Compile/Run or Compile/Debug buttons, then no, it does not seem to notice the /Unicode option. Is that by design?
Compile/Run should also work [F5/F6] ... seems to work for ts-soft :?:
Could you check in \Compilers if the generated executable after Compile/Run (Purebasic0.exe for exemple) imports the W functions (MessageBoxW ...) ?