View Full Version : Counterpart for CharToOEM$
dear all,
is there Counterpart for CharToOEM$?
I have files in CP850 and have to change this OEMToChar and can't found a function for this.:confused:
Thanks for your support.
Kind Regards
Axel
axelmoe, there is OemToCharBuff(var S:AmsiString) inside the unins000.exe in thinbasic folder, also can be seen in thinCore.dll. ( i am using Search and Replace utility from funduc to find things inside files)
but it is not implemented nor OemToChar(...)
its declarations can be found in win32api.inc like this
Declare Function OemToChar Lib "USER32.DLL" Alias "OemToCharA" (lpszSrc As Asciiz, lpszDst As Asciiz) As Long
so we have 3/4 of the road toward the solution
the win32api.inc is here:
http://www.neosoftware.com/community/viewtopic.php?t=20227&p=11211778
go down the page to app.box... and download it together with other inc files.
but it does not suitable immediately to thinbasic ,it needs some manipulation. in fact i will do more research but now i have severe cough symptoms.
and thanks for posting such thing, it can be useful for me also
regards
i hope this works:
Uses "Console"
Declare Function OemToChar Lib "USER32.DLL" Alias "OemToCharA" (lpszSrc As Asciiz, lpszDst As Asciiz) As Long
Dim a As Long
Dim strSrc, strDest, ss As Asciiz
strSrc = "hello world"
a = OemToChar(strSrc, strDest)
PrintL VarPtr(strDest)
ss = Peek$(Asciiz, VarPtr(strDest))
PrintL ss
MsgBox(0, ss)
WaitKey
yet i haven't done reading about what these functions do
the thinbasic CHM lack the help for CharToOem$, it is available only in thinbasic web help
the OemToChar and its sister are not available in the free powerbasic 9.07 it is available only in powerbasic 10