flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 04 Dec 2013, 18:03
You can use the wsprintf API. Just remember that it is a C-Call convention function.
|
|||
![]() |
|
clamicun 04 Dec 2013, 18:20
yes thanks, but I want to use the messagebox. And why does Bill G. say "Do not use" wsprintf ?
|
|||
![]() |
|
baldr 04 Dec 2013, 18:29
clamicun,
For simple string concatenation lstrcpy() / lstrcat() will suffice. wsprintf() can be used to construct more complex strings. Those functions have to be used carefully, they don't know output buffer size and easily can overflow it. FormatMessage() is safer in that sense. |
|||
![]() |
|
revolution 04 Dec 2013, 18:34
baldr wrote: wsprintf() can be used to construct more complex strings. Those functions have to be used carefully, they don't know output buffer size and easily can overflow it. |
|||
![]() |
|
clamicun 04 Dec 2013, 18:56
My problem continues...
How do I get the 2 vars (lpVolumeNameBuffer and/or lpOut from wsprintf) into the err_message ? Example ? |
|||
![]() |
|
baldr 04 Dec 2013, 19:28
clamicun,
That's easy: Code: cinvoke wsprintf, err_message, fmt_err_msg, lpVolumeNameBuffer ;... fmt_err_msg TCHAR 'Wrong Pendrive "%s" - Continue ??',0 err_message TCHAR 100 dup ? |
|||
![]() |
|
revolution 04 Dec 2013, 19:55
baldr wrote: clamicun, |
|||
![]() |
|
baldr 04 Dec 2013, 21:46
revolution wrote: I think you will need brackets around lpVolumeNameBuffer ![]() |
|||
![]() |
|
clamicun 05 Dec 2013, 16:45
YES, it works - without brackets. I understand the "%s" is lpVolumeNameBuffer.
Thank you guys a lot! clamicun from Germany |
|||
![]() |
|
revolution 05 Dec 2013, 17:07
clamicun wrote: YES, it works - without brackets. |
|||
![]() |
|
clamicun 05 Dec 2013, 17:35
ok. I'll consider that.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.