473,748 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Alignment is not properly by use MessageBox

I use MessageBox to show a command usage.I hope parameters and comments keep
left alignment,so I insert space char to format them.
But the result was not like I expected, it looks all space char was taken
place by '\t' when box popup.
I want MessageBox show alignment just like using printf.
Who can tell me how to resolve it?
Thanks.
_______________ _______________ _________
#include <iostream>
#include<window s.h>
#include <stdlib.h>
#include <tchar.h>
#include <stdio.h>
#include <Winuser.h>

#define USAGE \
"\n -p1 display additional output" \
"\n -p2ffff run the application in offline mode" \
"\n -p3aa run the application from the system cache only"\
"\n -p3aafda run the application from the system cache only"\
"\n\n"

int _tmain(int argc, _TCHAR* argv[])
{
printf("title" " %s\n", USAGE);
MessageBox(NULL , USAGE, "title",MB_ OK );
MessageBoxEx (NULL,USAGE, "title", MB_OK ,0);
return 0;
}
Nov 17 '05 #1
0 695

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
17693
by: Shashi | last post by:
Can somebody explain how the byte alignment for structures work, taking the following example and considering: byte of 1 Byte word of 2 Bytes dword of 4 Bytes typedef struct { byte a; word b;
67
10742
by: S.Tobias | last post by:
I would like to check if I understand the following excerpt correctly: 6.2.5#26 (Types): All pointers to structure types shall have the same representation and alignment requirements as each other. All pointers to union types shall have the same representation and alignment requirements as each other. Does it mean that *all* structure (or union) types have the same alignment? Eg. type
13
684
by: sachin_mzn | last post by:
Hi, What is the concept of memory alignment? Is memory alignment differs, If a data type is local to a function or if it is a member of structure or union? How 32 to 64 bit processor afftects the memory alignment?
14
1953
by: gamja | last post by:
Hi all. This is my first post on this group. Nice to meet you, cool guys~! I'm on system programming on various embedded systems and understand very well the byte alignment issues. When I write C code, especially design a structure, I pay attention to the order and size of member variables. Because, my boss always says that all variables should be aligned by 4byte boundary, if not a data abort will be occurred on a specific machine such...
13
2996
by: aegis | last post by:
The following was mentioned by Eric Sosman from http://groups.google.com/group/comp.lang.c/msg/b696b28f59b9dac4?dmode=source "The alignment requirement for any type T must be a divisor of sizeof(T). (Proof: In `T array;' both `array' and `array' must be correctly aligned.) Since `sizeof(unsigned char)' is divisible only by one and since one is a divisor of every type's size, every type is suitably aligned for `unsigned char'."
10
2211
by: haomiao | last post by:
I want to implement a common list that can cantain any type of data, so I declare the list as (briefly) --------------------------------------- struct list { int data_size; int node_num; char nodes; //will be list_node1,list_node2... };
10
5569
by: Francine.Neary | last post by:
I've been trying to understand the design decision to have one (well, three of course, but essentially one) allocation function that returns a pointer guaranteed to be aligned for any type. It seems to me that there's a tradeoff here between flexibility and efficiency. It's easy to imagine on a 64-bit machine that, say, a long or a pointer would need to be aligned at an 8-byte boundary. Then if you have a program with a large number of...
6
5184
by: Francois Grieu | last post by:
Hello, I'm asking myself all kind of questions on allocating an array of struct with proper alignment. Is the following code oorrect ? I'm most interested by the statement t = malloc(n*sizeof(r)) and (to a degree) by the surrounding error checking.
31
1683
by: Chris Thomasson | last post by:
How many C compilers provide extensions which allow for a standard implementation of the following hack? ____________________________________________________________________ #include <stdio.h> typedef union aligner_types_u aligner_types; typedef struct aligner_offset_s aligner_offset;
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.