Re: Localization help... (stange InitInstance behavior)
We have been diving into this problem and it looks like ATL should be picking
up the same resource only dll that MFC is using.
Here in InitInstance() it is correctly picking up our resource only dll and
calling SetResourceInstance and SetResourceHandle.
BOOL CWinApp::InitInstance()
{
InitLibId();
m_hLangResourceDLL = LoadAppLangResourceDLL();
if(m_hLangResourceDLL != NULL)
{
AfxSetResourceHandle(m_hLangResourceDLL);
_AtlBaseModule.SetResourceInstance(m_hLangResourceDLL);
}
return TRUE;
}
The problem is that after InitInstance returns the
_AtlBaseModule.GetResourceInstance is returning a different handle then
AfxGetResourceHanlde. Somehow the _AtlBaseModule.m_hInstResource is being
changed and I have not been able to figure out what is causing it. Setting a
data breakpoint on m_hInstResource did not catch it.
"Igor Tandetnik" wrote:
Cadwell <Cadwell@discussions.microsoft.com> wrote:
So I am going to need to determine which resource only .dll is
appropriate and then call SetResourceInstance with the HINSTANCE of
that .dll in each of my projects?
Yes.
Where should the SetResourceInstance and AddResourceInstance calls be
made from? CS3WinApp::InitInstance()?
Sounds like a good place.
You don't need both AddResourceInstance and SetResourceInstance - one
(either one) is sufficient. I'm not sure why ATL provides both.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925