Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Implementing CExtFormulaGrid in ActiveX (Assertion while editing) Collapse All
Subject Author Date
Bernd Lörler May 25, 2010 - 6:40 AM

Hello,


I’m using Prof-UIS 2.89 with VisualStudio 2005 on Windows XP. I’m new to Prof-UIS and so I don’t know, if I forgot some initializing.


I try to implement the CExtFormulaGrid in an ActiveX. I do this by declaring a member in the COleControl derived class.


class CProfUisOcxCtrl : public COleControl
 {
     CExtFormulaGridWnd	  m_grid;

 In the OnCreate-Member I create the Formula Grid.


 


int CProfUisOcxCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) {     if (COleControl::OnCreate(lpCreateStruct) == -1)     return -1;     if( !m_grid.Create( this ) )     {     return -1;     }     m_grid.DefaultInit( 26, 100 );     return 0; }


The OnSize member is used to set the grid to the size of the ActiveX


 


void CProfUisOcxCtrl::OnSize(UINT nType, int cx, int cy)
{
    COleControl::OnSize(nType, cx, cy);

    m_grid.MoveWindow( 0, 0, cx, cy );
}

This works, but when I’m in editing mode and click on other cell in the grid, I get an assertion in extedit.h line 509.


 


Can you please help me fixing the problem.


 


Best regards,


Bernd

Bernd Lörler May 25, 2010 - 1:46 PM

Thanks for the fast reply.


In my projects preprocessor settings __PROF_UIS_FOR_REGULAR_DLL is defined.


My InitInstance method looks like this:


BOOL CProfUisOcxApp::InitInstance() { BOOL bInit = COleControlModule::InitInstance(); if (bInit) { CExt_ProfUIS_ModuleState::InitExtension( AfxGetStaticModuleState() ); } return bInit; }


Did I miss something?


Regards


 

Bernd Lörler May 25, 2010 - 1:58 PM

Thanks for the fast reply.


 


In my projects preprocessor settings __PROF_UIS_FOR_REGULAR_DLL is defined.


 


My InitInstance method looks like this:


 


BOOL CProfUisOcxApp::InitInstance() { BOOL bInit = COleControlModule::InitInstance(); if (bInit) { CExt_ProfUIS_ModuleState::InitExtension( AfxGetStaticModuleState() ); } return bInit; }


 


Did I miss something?


 


Regards

Technical Support May 26, 2010 - 12:12 PM

The initialization code looks OK. Assert line 509 in the ExtEdit.h file is related to a rich editor control subclassed with the CExtEditBase-derived class. The CExtFormulaGridWnd control uses a rich edit control for in-place colorized formula editing. If an MFC project uses a rich editor, then it should invoke the ::AfxInitRichEdit() API in the InitInstance() virtual method of the CWinApp-derived class. Please check this.

Bernd Lörler May 26, 2010 - 2:54 PM

Thanks.


This seems to solve the problem.

Technical Support May 25, 2010 - 9:07 AM

The MFC ActiveX project is the MFC regular DLL project type. First of all, please read this:

http://www.prof-uis.com/prof-uis/tech-support/faq/miscellaneous.aspx#how-to-use-prof-uis-in-my-dll-project