Verfasst: 11.05.2009 20:32
DLL ist zumindest unter Vista nicht verwendbar, würde ich demnach auch
nicht tun, es sei denn, das Programm soll nur bei Dir laufen.
Korrekte Bufferlängen liefert die API-Funktion ja, man muß es nur
entsprechend nutzen.
nicht tun, es sei denn, das Programm soll nur bei Dir laufen.
Korrekte Bufferlängen liefert die API-Funktion ja, man muß es nur
entsprechend nutzen.
Code: Alles auswählen
EnableExplicit
Define FF, size, *mem, result, *unistring
Define text.s
FF = ReadFile(#PB_Any, "test.data")
If FF
size = Lof(FF)
*mem = AllocateMemory(size)
If *mem
ReadData(FF, *mem, size)
result = MultiByteToWideChar_(54936, 0, *mem, size, *unistring, 0)
If result
*unistring = AllocateMemory(result + 2)
If *unistring
If MultiByteToWideChar_(54936, 0, *mem, size, *unistring, result)
text = PeekS(*unistring, result, #PB_Unicode)
EndIf
EndIf
EndIf
Else
CloseFile(FF)
EndIf
EndIf
OpenWindow(0, #PB_Ignore, #PB_Ignore, 850, 70, "", #PB_Window_SystemMenu)
StringGadget(0, 10, 10, 830, 40, "")
SetGadgetFont(0, FontID(LoadFont(#PB_Any, "SimSun", 24)))
SetGadgetText(0, text)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow