|
i have three character string
char str1[10];
char str2[10];
char str3[10];
my textbox hwnd name is hEditbox;
i want to display only one string in one line.i made my textbox as multiline edit.how to do in program to display in different lines.
please reply fast.
|
|
|
|
|
suresh_sathya wrote:
please reply fast.
Then pay me for my answer, please.
suresh_sathya wrote:
i want to display only one string in one line
What is wrong with appending line breaks to your strings?
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
i tried to use
strcat(str1,"\n");
but it didnt worked out.
|
|
|
|
|
Its "\r\n" to get an edit control to put in a line break
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
You may find additional information here[^]
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
suresh_sathya wrote:
please reply fast.
You must be joking. This is the best way to get people to ignore your post, it's plain rude.
You need to build a string from your three char arrays, and put a \r\n between each one.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
suresh_sathya wrote:
please reply fast
okay. done.
|
|
|
|
|
Does anyone know how to programmatically set the maximum size of an event log? (This is possible in the EventViewer, but I don't know how that would work by using the EventLog API.)
|
|
|
|
|
You can set it in the registry.. The keys are under..
HKLM\System\CurrentControlSet\Services\EventLog\Application or Security or System...
Rob
|
|
|
|
|
Hi
This is an object oriented programming question.
I want to make a poster, which contains Images and textes.
the poster may contain any number of elements.
so if I have CElement a parent class, from which I derive CImage, CText, CRectangle, and so on
how can I implement the CPoster class
the main problem for me is that the number of element is not fixe, so I don't know if there is one or 2 or .... images.
Another problem is that I Want to save the poster to modifie it later.
how can I do this?
thank you for help
khaldoun
|
|
|
|
|
khaldoun wrote:
I want to make a poster, which contains Images and textes.
So the Poster aggregates/contains Images and Texts, so make these two member variables ...
khaldoun wrote:
the poster may contain any number of elements.
khaldoun wrote:
the main problem for me is that the number of element is not fixe, so I don't know if there is one or 2 or .... images.
You could past the number of elements as a argument to the CPoster constructor ... and btw make it explicit , since you don't want implict conversion from int (if this is the variale type chosen to past the number of elements) to CPoster ...
khaldoun wrote:
Another problem is that I Want to save the poster to modifie it later.
That's a very open question , if you are using MFC, take a look at the Serialization support that MFC offers by the dreaded and omnipotent CObject ... it basically serializes by default on a CArchive , must you should override this to add your member variables that are important to maintain the state of your poster , in this case Images, texcts and rectangles ...
This MFC articles explains well the Serialization(Saving/loading) process ...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_Serialization_Topics.asp[^]
Cheers,Joao Vaz
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary.-Shog9
Remember just because a good thing comes to an end, doesn't mean that the next one can't be better.-Chris Meech
|
|
|
|
|
If I declare a dynamic array of CElement as a member of the CPoster class.
and if i use MFC Serialization,
suppose thant CElement has Save() and Load() methods
and each derived class (CImage, CText, ..) has its implementation of these methods
so when I want to save my poster
for (j = 0; j< m_nNoElement; j++)
rgElement[j].save(strFileName);
and like this when the element is an CImage class I am calling the CImage::Save(strFileName) function
but when I want to load my poster
for (j = 0; j< m_nNoElement; j++)
rgElement[j].Load(strFileName);
here I think that i call the CElement::Load(strFileName) instead of CImage::Load(strFileName)
what do you think
thank you
khaldoun
|
|
|
|
|
khaldoun wrote:
If I declare a dynamic array of CElement as a member of the CPoster class.
Yeap, duh, of course you could use a CArray or a CArrayList or a STL vector .. if the number is unknow at compile time , what it's more normal to happen , I should have added this on the previous post
khaldoun wrote:
here I think that i call the CElement::Load(strFileName) instead of CImage::Load(strFileName)
Yes, it's quite natural do this, this is why you derived the CImage and al from CElement, and will make this Load and Save methods virtual in CElement to obtain polimorfic behaviour, didn't you
BTW your Load and Save methods in the implementation could call the CArchive << and >> virtual methods of COBject as I explained in the post and on the msdn link
Cheers,Joao Vaz
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary.-Shog9
Remember just because a good thing comes to an end, doesn't mean that the next one can't be better.-Chris Meech
|
|
|
|
|
I suggest you use a container (CArray or maybe std::vector ) of pointers to CElement objects.
Use virutal methods to implement the CElement-derived classes so when you iterate through the container of pointers, thanks to polymorphism, you don't have to worry about calling the right method.
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
VC add resource(Version, Icon, Menu, Dialog etc.) to MFC app/dll automaticly.
but not Win32 DLL.
we need add standard version info(like what you see in the Properties dialog of a DLL file in Windows Explorer) to a DLL project. any advice is welcome
|
|
|
|
|
From the IDE, it is not difficult.
With your projet open, go to File | New, and choose "resource script". Make sure you insert it in your project, and you can then edit its resources like you would anything else.
Just don't try to use Class Wizard.
Even a broken clock is right twice a day.
|
|
|
|
|
I need in my program to get the default web browser on my system. How???
|
|
|
|
|
Why do you need to get the default browser? If you are just launching an HTML file, check out the ShellExecute function, which launches whatever program is associated with the file type specified.
Even a broken clock is right twice a day.
|
|
|
|
|
I need open many instances of a browser in separate windows and uses for it CreateProcess, so SheelExecute in this case is not applicable.
|
|
|
|
|
Where is the [edit]"use MFC in a static library"[edit] option in VC6SE (standard edition). I ran across this question in a another forum and realized I'm going to need the answer myself as I'm using an older machine with the SE version on it (Crashed my other PC and wont have it running again until sometime tomorrow - which wont help me in about two hours when I compile the release on the project I'm working on now) and no license to upgrade on this PC. Anyone know, its been a long time since I've used this PC for programming apps.
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler <
|
|
|
|
|
It's not on the General tab in Project Settings in the Standard Edition?
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
Not on mine... just "MFC in shared DLL" and attempting to add I don't have the static library feature.. and even after a full install don't have it. Do YOU?
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler <
|
|
|
|
|
I have Enterprise Edition. I just looked it up. The Comparison Chart of Features in Each Visual C++ Edition says Static linking to the MFC Library isn't offered in the Standard Edition. That sucks!
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
hey... i found that out too. I did a msg that I can find a work around here on codeproject but searching for it seems to be rather a pain... I appreciate your assistance though.. if you aren't easily offened, see this link.. I just posted the phote enough people told me its not really offensive... http://profiles.yahoo.com/cpp_w_mfc[^] it won a best costume at a halloween party here locally.
|
|
|
|
|
I just took a peek at your profile. Just thought it worth mentioning that I recently considered hiring a programmer to help me out with some of the "grunt" work and mentioned it in the lounge here. I was actually thinking of hiring between two local people I know but the reponse to my query got me to realize the CP is likely a better idea for finding programmers. Doesn't pay a great deal... right now I can only offer $30(US) and hour and it would be spuradic.. mostly needed when I agree to very short dead lines. Just the same... if you think you might be interested, my email is mfeik@comporium.net and I just started my own company and as it grows (as I hope it does, I will be able to pay better.
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler <
|
|
|
|