Click here to Skip to main content
15,890,690 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to enble menu item in a system menu? Pin
vasu_sri20-Jul-10 21:29
vasu_sri20-Jul-10 21:29 
AnswerRe: how to enble menu item in a system menu? Pin
«_Superman_»20-Jul-10 21:41
professional«_Superman_»20-Jul-10 21:41 
GeneralRe: how to enble menu item in a system menu? Pin
vasu_sri20-Jul-10 22:50
vasu_sri20-Jul-10 22:50 
QuestionGDI+ Pin
john563220-Jul-10 21:26
john563220-Jul-10 21:26 
AnswerRe: GDI+ Pin
john563221-Jul-10 1:36
john563221-Jul-10 1:36 
AnswerRe: GDI+ [modified] Pin
Luc Pattyn21-Jul-10 2:20
sitebuilderLuc Pattyn21-Jul-10 2:20 
Questionchar buffer append Pin
gmallax20-Jul-10 20:22
gmallax20-Jul-10 20:22 
AnswerRe: char buffer append Pin
Code-o-mat20-Jul-10 20:48
Code-o-mat20-Jul-10 20:48 
gmallax wrote:
Is any way to do this?

yep

gmallax wrote:
could you help me.

will try

So, if you know in advance the size of these buffers, or at least the maximum length of possible strings, then e.g. (i assumed your strings are zero-terminated, if not then tell me so):
char buffer40[40];
char buffer50[50];
...initialize your buffers with whatever content you need to...
char buffer90[40 + 50]; //I could have written 90 here instead of 40+50, it's just so for clearity's sake
strcpy(buffer90, buffer40);
strcap(buffer90, buffer50);
...both of your strings are in buffer90 now...

See strcpy[^] and strcat[^] in MSDN.

If you do not know the sizes of these strings in advance, or you just don't want to waste memory, then e.g.:
char first_buffer[whatever size_1];
char second_buffer[whatever size_2];
...initialize your buffers with whatever content you need to...
char *concatenated_buffer = new char[strlen(first_buffer) + strlen(second_buffer) + 1];
strcpy(concatenated_buffer, first_buffer);
strcat(concatenated_buffer, second_buffer);
...both of your strings are in concatenated_buffer now...
delete []concatenated_buffer;

See strlen[^] in MSDN for info.

I hope this helps, error checks are avoided for simplicity.

[EDIT] I just realized i simply assumed your character buffers contain strings, which you didn't explicitly state so i might be wrong, if i am, then tell me so and we'll think of something else [EDIT]
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

AnswerRe: char buffer append Pin
Niklas L20-Jul-10 21:50
Niklas L20-Jul-10 21:50 
AnswerRe: char buffer append Pin
Aescleal20-Jul-10 22:19
Aescleal20-Jul-10 22:19 
QuestionOpenGL, cross-platformity, and general nincompoopery Pin
Asday20-Jul-10 15:17
Asday20-Jul-10 15:17 
AnswerRe: OpenGL, cross-platformity, and general nincompoopery [modified] Pin
Sauro Viti20-Jul-10 21:24
professionalSauro Viti20-Jul-10 21:24 
GeneralRe: OpenGL, cross-platformity, and general nincompoopery Pin
Asday20-Jul-10 23:29
Asday20-Jul-10 23:29 
GeneralRe: OpenGL, cross-platformity, and general nincompoopery Pin
Sauro Viti21-Jul-10 0:06
professionalSauro Viti21-Jul-10 0:06 
GeneralRe: OpenGL, cross-platformity, and general nincompoopery Pin
Asday21-Jul-10 0:30
Asday21-Jul-10 0:30 
GeneralRe: OpenGL, cross-platformity, and general nincompoopery Pin
Sauro Viti21-Jul-10 0:51
professionalSauro Viti21-Jul-10 0:51 
QuestionHow could I pass data from MFC application to .Net user control? Pin
Daniel Tong20-Jul-10 13:23
Daniel Tong20-Jul-10 13:23 
AnswerRe: How could I pass data from MFC application to .Net user control? Pin
Code-o-mat20-Jul-10 20:59
Code-o-mat20-Jul-10 20:59 
GeneralRe: How could I pass data from MFC application to .Net user control? Pin
Daniel Tong21-Jul-10 7:49
Daniel Tong21-Jul-10 7:49 
GeneralRe: How could I pass data from MFC application to .Net user control? Pin
Daniel Tong21-Jul-10 7:52
Daniel Tong21-Jul-10 7:52 
GeneralRe: How could I pass data from MFC application to .Net user control? Pin
Code-o-mat21-Jul-10 8:24
Code-o-mat21-Jul-10 8:24 
Questionhow to add cur resources to any executable by program? Pin
nenfa20-Jul-10 10:34
nenfa20-Jul-10 10:34 
QuestionRe: how to add cur resources to any executable by program? Pin
David Crow20-Jul-10 10:51
David Crow20-Jul-10 10:51 
AnswerRe: how to add cur resources to any executable by program? Pin
nenfa20-Jul-10 16:02
nenfa20-Jul-10 16:02 
GeneralRe: how to add cur resources to any executable by program? Pin
Code-o-mat20-Jul-10 21:09
Code-o-mat20-Jul-10 21:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.