2

I am writing a DLL written in MFC to be used by other application.
project settings:
1. Use MFC in static library
2. preprocessor : AFXDLL
3. MD Build

I have also used AFX_MANAGE_STATE (AfxGetStaticModuleState()) before calling CWinApp which internally calls InitInstance and DLL main.

This Dialog has tab in it and I am able to see only the first tab all other tab are coming as blank. When I am running the same DLL as exe (with required changes) its working fine.
Also DLL is crashing when i am calling AfxGetApp() ? I suppose major problem is due to DOMODAL(). Can anyone tell what might be the issue of tab control not working?

Update I found out that CRichEditCtrl was the problem. In dialog tab I had this as well when I removed this It worked fine. Can anyone know the reason of this.. I have used AfxInitRichEdit2() before in InitiInstance()

I am new to MFC so let me know if you need any more info

2 Answers 2

1

You have to call AfxInitRichEdit() before the rich edit control is used.

Sign up to request clarification or add additional context in comments.

Comments

0

Do you call AfxInitRichEdit2 in InitInstance of the EXE?

Try putting it in the DLL's InitInstance too!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.