Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

C++ CRichEditCtrl problems

Managed C++

  • Please log in to reply
4 replies to this topic

#1 Saurian

Saurian

    CC Regular

  • Member
  • PipPipPip
  • 28 posts
  • Location:Bucharest
  • Programming Language:C, Java, C++, PHP
  • Learning:C, Java, C++, PHP

Posted 14 September 2012 - 04:58 AM

Hi to everyone. I'm trying to work on a project on Visual C++ and use a CRichEditControl ( I use the MFC control and Visual Studio 2012 RC ). The problem is that when I run the project it doesn't appear the dialog form and it's said that the program exited with code 0. All what I do is create a MFC Application, put a CRichEditCtrl 2.0. I tried to use the AfxInitRichEdit function like here: http://www.functionx...ls/richedit.htm and nothing. Anyone has any idea what can I do? Thanks in advance!
  • 0

#2 kernelcoder

kernelcoder

    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 990 posts
  • Location:Dhaka
  • Programming Language:C, Java, C++, C#, Visual Basic .NET
  • Learning:Objective-C, PHP, Python, Delphi/Object Pascal

Posted 14 September 2012 - 07:00 PM

Well, it just worked for me. I just put the line '::AfxInitRichEdit2();' at the very first line of the 'InitInstance()' method of the application class. BTW, I tested on Win XP SP3 with Visual Studio 2010.
  • 0

#3 Saurian

Saurian

    CC Regular

  • Member
  • PipPipPip
  • 28 posts
  • Location:Bucharest
  • Programming Language:C, Java, C++, PHP
  • Learning:C, Java, C++, PHP

Posted 14 September 2012 - 11:30 PM

I've noticed that I receive 2 Warnings when I build the app.Can anyone understand what might be the problem?

Warning: dialog creation failed, so application is terminating unexpectedly.
Warning: if you are using MFC controls on the dialog, you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS.

  • 0

#4 kernelcoder

kernelcoder

    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 990 posts
  • Location:Dhaka
  • Programming Language:C, Java, C++, C#, Visual Basic .NET
  • Learning:Objective-C, PHP, Python, Delphi/Object Pascal

Posted 15 September 2012 - 01:02 AM

What is your OS -- XP, WIn7 or later?

Read this blog for help to run MFC apps under XP created with VS2012.
  • 0

#5 Saurian

Saurian

    CC Regular

  • Member
  • PipPipPip
  • 28 posts
  • Location:Bucharest
  • Programming Language:C, Java, C++, PHP
  • Learning:C, Java, C++, PHP

Posted 15 September 2012 - 01:09 AM

What is your OS -- XP, WIn7 or later?


I'm using Win7. Other applications I can build but my problem appears only when I put a CRichEditCtrl on the dialog box. If I use a CEdit everything is Ok.
  • 0





Also tagged with one or more of these keywords: Managed C++

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download