Fix for beeping on windows (untested)

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Fix for beeping on windows (untested)

#1 Post by EternalHarvest »

In src/auto/XSTools/win32/utils.cpp, add MB_USEGLYPHCHARS flag to the second argument of WideCharToMultiByte calls.

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Fix for beeping on windows (untested)

#2 Post by kLabMouse »

EternalHarvest wrote:In src/auto/XSTools/win32/utils.cpp, add MB_USEGLYPHCHARS flag to the second argument of WideCharToMultiByte calls.
dwFlags
[in] This specifies whether to translate to precomposed or composite wide characters if a composite form exists, whether to use glyph characters in place of control characters, and how to deal with invalid characters.
You can specify a combination of the flag constants shown in the following table.

MB_PRECOMPOSED -- Always use precomposed characters — that is, characters in which a base character and a nonspacing character have a single character value.
This is the default translation option. Cannot be used with MB_COMPOSITE.

MB_COMPOSITE -- Always use composite characters — that is, characters in which a base character and a nonspacing character have different character values.
Cannot be used with MB_PRECOMPOSED.

MB_ERR_INVALID_CHARS -- If the function encounters an invalid input character, it fails and GetLastError returns ERROR_NO_UNICODE_TRANSLATION.
MB_USEGLYPHCHARS -- Use glyph characters instead of control characters.

A composite character consists of a base character and a nonspacing character, each having different character values.

A precomposed character has a single character value for a base/nonspacing character combination.

In the character è, the e is the base character and the accent grave mark is the nonspacing character.

The function's default behavior is to translate to the precomposed form. If a precomposed form does not exist, the function attempts to translate to a composite form.

The flags MB_PRECOMPOSED and MB_COMPOSITE are mutually exclusive. The MB_USEGLYPHCHARS flag and the MB_ERR_INVALID_CHARS can be set regardless of the state of the other flags.



I suppose. MB_USEGLYPHCHARS should disable the \b and other control characters.

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Fix for beeping on windows (untested)

#3 Post by EternalHarvest »

Maybe somebody with Windows can compile, test, and make new binaries if it works correctly.

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Fix for beeping on windows (untested)

#4 Post by kLabMouse »

EternalHarvest wrote:Maybe somebody with Windows can compile, test, and make new binaries if it works correctly.
I can patch and make new exe (but I donno about tests). But I better upgrade to latest ActivePerl before I do that.
And that will happen after 1 Jan 2011

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Fix for beeping on windows (untested)

#5 Post by kLabMouse »

Done.
Exes compiled with Perl 5.12 and uploaded to misc.openkore.com;
Guide Updated to the state, I used to make this Release.
Files updated to match new SCons and Perl 5.12+.

Fixed win32/utils.cpp and win32/wrapper.xs.

User avatar
lolzorbot
Noob
Noob
Posts: 18
Joined: 28 Apr 2010, 16:20
Noob?: No

Re: Fix for beeping on windows (untested)

#6 Post by lolzorbot »

kLab thanks for updating everthing but
when starting the new 2010-01-01 binaries (start or wxstart)

i get a cant find libgcc_s_dw2-1.dll error (you forgot the compile it into the exe?)

after clicking ok i get this

Code: Select all

Can't load 'D:/openkore/XSTools.dll' for module XSTools: 
load_file:The specified module could not be found at /<D:\openkore\wxstart.exe>DynaLoader.pm line 219.
 at openkore.pl line 25
Error: XSTools.dll is not found. Please check your installation.
googled a bit and found this:
> Is it possible to build release binaries without this dependancy?
Yes, add -static-libgcc when compiling.

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Fix for beeping on windows (untested)

#7 Post by kLabMouse »

lolzorbot wrote:kLab thanks for updating everthing but
when starting the new 2010-01-01 binaries (start or wxstart)

i get a cant find libgcc_s_dw2-1.dll error (you forgot the compile it into the exe?)

after clicking ok i get this

Code: Select all

Can't load 'D:/openkore/XSTools.dll' for module XSTools: 
load_file:The specified module could not be found at /<D:\openkore\wxstart.exe>DynaLoader.pm line 219.
 at openkore.pl line 25
Error: XSTools.dll is not found. Please check your installation.
googled a bit and found this:
> Is it possible to build release binaries without this dependancy?
Yes, add -static-libgcc when compiling.
OK. I gonna Recompile.
As for XSTools.dll, it's not made into EXE files, it go by the second ARC. You better use full.zip to get all the DLLS and EXE's on place.

Stay in Touch, this gonna take a some time.

DrKN
Developers
Developers
Posts: 79
Joined: 06 Oct 2010, 09:22
Noob?: No

Re: Fix for beeping on windows (untested)

#8 Post by DrKN »

Tested by macro

Code: Select all

macro test {
	do c @eval("\a"x2)
}
but still beeping :S

Locked