It is currently Wed Aug 22, 2018 6:41 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: wsprintf is missing
PostPosted: Sat Nov 01, 2003 8:54 pm 
Offline
New User
New User

Joined: Fri Sep 19, 2003 9:35 am
Posts: 2
i'm not quite sure but i think this should also be written in the bug list: the windows-api-call wsprintf is not supported by purebasic!
wvsprintfa can be used but i have not managed to get a working example for this... can anyone supply one?


Top
 Profile  
Reply with quote  
 Post subject: Re: wsprintf is missing
PostPosted: Thu Jun 01, 2017 2:01 pm 
Offline
User
User

Joined: Sun Apr 30, 2017 12:27 pm
Posts: 16
OpenLibrary(0, "User32.dll")
PrototypeC.i protoFunction(*buf.p-unicode, a.p-unicode, b.l)
wsprintf.protoFunction = GetFunction(0, "wsprintfW")
CloseLibrary(0)

a = 5
n.s = "A: %d"

buffer.s = Space(50)

CharsWritten = wsprintf(@buffer, n, a)

Debug buffer
Debug CharsWritten
Debug Len(buffer)


Top
 Profile  
Reply with quote  
 Post subject: Re: wsprintf is missing
PostPosted: Sat May 26, 2018 2:17 am 
Offline
User
User

Joined: Sun Apr 30, 2017 12:27 pm
Posts: 16
Code:
OpenConsole()
u32dll = OpenLibrary(#PB_Any, "user32.dll")
*f = GetFunction(u32dll, "wsprintfW")
CloseLibrary(u32dll)

szBuffer.s = Space(1024)
szFormat.s = "%-13s %3d %-15s%c%6u %4d %3s %3s %4s %4s"
szTemp1.s = "第一个字符串。"
szTemp2.s = "第二个字符串。"
szTemp3.s = "第三个字符串。"
szTemp4.s = "第四个字符串。"
szTemp5.s = "第五个字符串。"
szTemp6.s = "第六个字符串。"

If *f
  CallCFunctionFast(*f, @szBuffer, @szFormat, @szTemp1, 42, @szTemp2, 65,1234, 5678, @szTemp3, @szTemp4, @szTemp5, @szTemp6)
  Print(szBuffer) 
EndIf

Input()
CloseConsole()


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye