Page 1 of 1

CoInitializeEx and TeeChart Problem in COM Environment.

Posted: Thu Mar 27, 2008 1:10 am
by 15046355
I've been making a program by MDI in VS 2005(MFC)
And also I'm connecting with server by COM.

I initiate at the part of connecting with COM Sever by CoInitializeEx(NULL,COINIT_MULTITHREADED) not the InitInstance().
And I intiate when the server logging.
I arrange OCX as same as the location of Project Directory and registered
by regsvr32.
And by connecting with the Server, I'll show the message count to the chart (Teechart ActiveX control ver.8 ) that sent a message on Child Window.
The problem is when running the Child Window, there is an error on
950 Line of the Occcont.cpp.
As a result of checking the point of being error by making a breakpoint,
the error is the red mark below the souce.
Well after I deleted this ActiveX control on the resouce and a part of DoDataExchange which connecting with controling, and compiled then it's worked well not any problem.
Is there any problem between doing CoInitializeEx when connecting with a server by COM and ActiveX control?

This is the content of Assertion.

--->
Debug Assertion failed!
File : f:rtm\vctools\vc7libs\ship\atlmfc\src\mfc\occcont.cpp
line : 950
<---

HWND GETSTATISTICSFV()
{
if(pSTATISTICSFrame)
{
pSTATISTICSFrame->ActivateFrame();
pSTATISTICSFrame->ShowWindow(SW_SHOWNORMAL);
return pSTATISTICSFrame->GetSafeHwnd();
}

CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_MAINFRAME,
RUNTIME_CLASS(CuiDoc), RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(Cstatistics));

AfxGetApp()->AddDocTemplate((CDocTemplate*)pDocTemplate);
pDocTemplate->OpenDocumentFile(NULL);
POSITION ps = pDocTemplate->GetFirstDocPosition();
CDocument* pdoc = pDocTemplate->GetNextDoc( ps );
ps = pdoc->GetFirstViewPosition();
pSTATISTICSFrame = pdoc->GetNextView( ps )->GetParentFrame();

return pSTATISTICSFrame->GetSafeHwnd();
}

Posted: Tue Apr 01, 2008 1:28 pm
by narcis
Hi seanlee76,

It's very difficult for us guessing where the problem might be without being able to reproduce it. Would you be so kind to send us a simple project we can run "as-is" to reproduce and debug the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.