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 General Discussion » Using Prof-UIS classes within multiple ActiveX controls Collapse All
Subject Author Date
Martin Chapman Aug 27, 2007 - 10:58 AM

I have a simple MFC MDI client exe that loads two ActiveX controls into two seperate windows using the method CWnd::CreateControl() from each parent CVPChildWnd window. Each ActiveX control does nothing more than call the paint manager on creation like so:

LRESULT CFeatureWndCtrl::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState())
    g_PaintManager.InstallPaintManager(RUNTIME_CLASS(CExtPaintManagerStudio2005));
    return 0;
}

When the CMainFrame window leaves the main windows destructor an exception is caught in CThreadLocalObject::GetData() on the following line of code: if (m_nSlot == 0) which is line 409 of afxtls.cpp in the MS core library. I am using VC 2005 and I have done all the appropriate steps compiling my activex dlls as RDE dlls by placing the recommended code in the InitInstance() function of my CWinApp derived class and linking to the -RDE prof-uis libs / dlls and specifying the preproccesor symbol __PROF_UIS_FOR_REGULAR_DLL.

The problem only occurs when I use prof-uis related classes in more than one activex control. If I only link one ActiveX control into my application everything is fine. Also, if I use any standard MFC classes like CTreeCtrl or CListCtrl everything is ok. If I use classes like CExtPropertyGridCtrl or CExtPageContainerWnd I get the same error. The OnCreate() function is the only line of code where anything occurs so there is nothing else to show in terms of code.

My question is, has anyone ever linked prof-uis classes into more than one activex control used from the same mfc exe, or does anyone see what my problem might be?

Best regards,

Martin

Martin Chapman Aug 27, 2007 - 9:53 PM

I think I figured it out. I just staically linked the prof-uis dll’s in my activex controls and then all the problems went away. I still link the prof uis dll’s dynamically in my main exe, and I am linking to mfc dynamically an both the exe and the activex dll’s. For anyone reading this you can learn how to statically link to prof-uis at http://www.prof-uis.com/FAQView.aspx?CID=104#FAQ419 .

Martin