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 » Problems in MDI project with Automation Collapse All
Subject Author Date
Joao Paulo Negri May 5, 2004 - 11:52 AM

There is a problem in Prof-UIS library when used in a MDI project with Automation. When I try to create a COM instance of my application using the library (in Microsoft Excel, for example) there is debug assertion on winmdi.cpp (line 509) and the object instance is not created.


This occurs in my CWinApp::InitInstance in the call COleTemplateServer::RegisterAll(). I’ve created two empty MDI projects, one using the Prof-UIS library and the second not using. I put a COM interface on both and try to create as instance of my app’s object in Microsot Excel. The problem occurs only int the project with Prof-UIS library. I can send the 2 projects and the Excel file for you.


Thanks.


 

Technical Support May 6, 2004 - 6:20 AM

Dear Joao,

We have not encountered this kind of problem before. Please send us your test project so that we can reproduce this bug and help you. Let us also know which version of Microsoft Excel you are using.

Joao Paulo Negri May 6, 2004 - 3:09 PM

I found the problem already. Looking at winmdi.cpp at line 509, we can see that the code asserts because the main window pointer is NULL. So I put the statement

 

COleTemplateServer::RegisterAll()

 

after  the statement

 

CMainFrame* pMainFrame = new CMainFrame;
 if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  return FALSE;
 m_pMainWnd = pMainFrame;

 

in my CWinapp::InisInstance and it works fine.

 

I’ve sent to you a zip file that contains 3 projects and an Excel file. Two project works with PROF-UIS library (one with the correction above). One project works fine without PROF-UIS library. The Excel file invokes the three COM interfaces, so we can see the error.

 

Thanks,