Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Rich Edit Control

WerewolfWareWerewolfWare Posts: 304Member
How can I attach a string varible to the Rich-Edit on a dialog based appliction?
«1

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : How can I attach a string varible to the Rich-Edit on a dialog based appliction?
    :

    you can't. if you want to set the text then use the control's SetWindowText() method.
  • WerewolfWareWerewolfWare Posts: 304Member
    : : How can I attach a string varible to the Rich-Edit on a dialog based appliction?
    : :
    :
    : you can't. if you want to set the text then use the control's SetWindowText() method.
    :

    I dont wanna set the text - I want to get the text from this object when I am doing something such as clicking a button - how do I do that

  • stoberstober Posts: 9,765Member ✭✭✭
    : : : How can I attach a string varible to the Rich-Edit on a dialog based appliction?
    : : :
    : :
    : : you can't. if you want to set the text then use the control's SetWindowText() method.
    : :
    :
    : I dont wanna set the text - I want to get the text from this object when I am doing something such as clicking a button - how do I do that
    :
    :

    GetWindowText()
  • WerewolfWareWerewolfWare Posts: 304Member
    [b][red]This message was edited by WerewolfWare at 2003-8-3 5:41:59[/red][/b][hr]
    : : : : How can I attach a string varible to the Rich-Edit on a dialog based appliction?
    : : : :
    : : :
    : : : you can't. if you want to set the text then use the control's SetWindowText() method.
    : : :
    : :
    : : I dont wanna set the text - I want to get the text from this object when I am doing something such as clicking a button - how do I do that
    : :
    : :
    :
    : GetWindowText()
    :
    It's not working
    for some reason - every appliction with a RichEdit is not working

  • stoberstober Posts: 9,765Member ✭✭✭
    : :
    : It's not working
    : for some reason - every appliction with a RichEdit is not working
    :
    :

    Then I assume there is something wrong with your programs becase that does indeed work.

    [code]
    CMyDialog::OnSomething()
    {
    CString str;
    m_RichCtrl.GetWindowText(str);
    }
    [/code]

  • FDracheFDrache Posts: 64Member
    : : GetWindowText()
    : :
    : It's not working
    : for some reason - every appliction with a RichEdit is not working

    Before every use of a CRichText, you must call
    AfxInitRichEdit();
    Strange, but it is so. Without this, everything hangs.
    Just in case you need only the unformatted text, a normal edit box does it and is far easier to handle.
  • WerewolfWareWerewolfWare Posts: 304Member
    : : : GetWindowText()
    : : :
    : : It's not working
    : : for some reason - every appliction with a RichEdit is not working
    :
    : Before every use of a CRichText, you must call
    : AfxInitRichEdit();
    : Strange, but it is so. Without this, everything hangs.
    : Just in case you need only the unformatted text, a normal edit box does it and is far easier to handle.
    :
    What will happen if I wo'nt
  • FDracheFDrache Posts: 64Member
    : : Before every use of a CRichText, you must call
    : : AfxInitRichEdit();
    : : Strange, but it is so. Without this, everything hangs.
    : : Just in case you need only the unformatted text, a normal edit box does it and is far easier to handle.
    : :
    : What will happen if I wo'nt

    Bill Gates says you must call AfxInitRichEdit() once before you construct the dialog where the object of type CRichText is in. If you don't, you get an "assertion error in wincore.cpp" as soon as you want to initialise the dialog. I've just tried it again in my application.
    Good luck.
  • WerewolfWareWerewolfWare Posts: 304Member
    : : : Before every use of a CRichText, you must call
    : : : AfxInitRichEdit();
    : : : Strange, but it is so. Without this, everything hangs.
    : : : Just in case you need only the unformatted text, a normal edit box does it and is far easier to handle.
    : : :
    : : What will happen if I wo'nt
    :
    : Bill Gates says you must call AfxInitRichEdit() once before you construct the dialog where the object of type CRichText is in. If you don't, you get an "assertion error in wincore.cpp" as soon as you want to initialise the dialog. I've just tried it again in my application.
    : Good luck.
    :
    Do I need to write like this:
    AfxInitRichEdit();
    Or like this:
    m_MyRichEditControlVarible.AfxInitRichEdit();
    ????????????
  • FDracheFDrache Posts: 64Member
    : Do I need to write like this:
    : AfxInitRichEdit();
    : Or like this:
    : m_MyRichEditControlVarible.AfxInitRichEdit();
    : ????????????
    :
    The 1st one is it. Just
    AfxInitRichEdit();

«1
Sign In or Register to comment.