flat assembler
Message board for the users of flat assembler.
Index
> Windows > Building variables |
Author |
|
revolution 04 Dec 2013, 18:03
You can use the wsprintf API. Just remember that it is a C-Call convention function.
|
|||
04 Dec 2013, 18:03 |
|
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 ?
|
|||
04 Dec 2013, 18:20 |
|
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. |
|||
04 Dec 2013, 18:29 |
|
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. |
|||
04 Dec 2013, 18:34 |
|
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 ? |
|||
04 Dec 2013, 18:56 |
|
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 ? |
|||
04 Dec 2013, 19:28 |
|
revolution 04 Dec 2013, 19:55
baldr wrote: clamicun, |
|||
04 Dec 2013, 19:55 |
|
baldr 04 Dec 2013, 21:46
revolution wrote: I think you will need brackets around lpVolumeNameBuffer |
|||
04 Dec 2013, 21:46 |
|
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 |
|||
05 Dec 2013, 16:45 |
|
revolution 05 Dec 2013, 17:07
clamicun wrote: YES, it works - without brackets. |
|||
05 Dec 2013, 17:07 |
|
clamicun 05 Dec 2013, 17:35
ok. I'll consider that.
|
|||
05 Dec 2013, 17:35 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.