Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello greetings to all : Why MFC Visual C++ 2003 project with RichEdit doesnt run ?

I am running a MFC Dialog project with Visual Studio 2003 on XP,
when I add a RichEdit 2.0 activex control the project just doesnt run or in theory run but does not show the main window/dialog and exits immediately. The exit code is CERO :
The program '[1264] xxxxxx.exe: Native' has exited with code 0

When I delete the control the project runs.

The compiler doesnt generate any error or warning.

If you know the answer and know if there is any difference en Visual Studio 2002 let me know because this is the real version in which I will work on.

Thank you in advance.
Posted
Comments
nv3 24-Feb-12 18:41pm    
I would suggest to compile the program in debug mode, set a break point in InitInstance and then step forward until you hit the point at which the problem occurs.

Did you call AfxInitRichEdit somewhere in your code (before creating the richedit control) ?

CRichEditCtrl on msdn[^]
 
Share this answer
 
Comments
fvalerin 26-Feb-12 14:10pm    
Thank you guys, it works. I put the AfxInitRichEdit2 after the AfxEnableControlContainer call and before the ...DoModal call

Like you may notice Im knew to MFC and C++

Before I put the question I tried the approach indicated by nv3 but it was complex and I reach to nowhere. Also I tried searching about the topic but found nothing.

Thank you too nv3.

For those who dont know ...
As Maximilien told , Call AfxInitRichEdit in InitInstance function of your Application class.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900