CoInitializeEx and TeeChart Problem in COM Environment.
Posted: Thu Mar 27, 2008 1:10 am
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();
}
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();
}