-
DoModal throws an access violation only for one language
Hi,
I have a few dialogs, icons, bitmaps, strings that I've localized in the
following way:
I've created a separate resource only dll which has a separate RC file for
each language.
This project also has a different build configuration for each language.
So that in that configuration only that dll will build and the resources
pane in the project properties will be set to the proper culture for each
build configuration.
I am loading that dll from a COM c++ dll in the following way:
m_hDll = ::LoadLibraryEx(filename.c_str(),NULL,LOAD_LIBRARY_AS_DATAFILE);
ATLASSERT(m_hDll != NULL);
ATL::_AtlBaseModule.SetResourceInstance(m_hDll);
AfxSetResourceHandle(m_hDll);
It loads successfully and loads the correct file.
For all the languages, but german, everything else also works good.
Issue #1
For german, DoModal throws an access violation.
Debugging MFC shows that this line throws the exception :
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,
pParentWnd->GetSafeHwnd(), AfxDlgProc);
hInst, lpDialogTemplate, AfxDlgProc are all fine and valid adresses.
m_hWnd of the pParentWnd is not :
m_hWnd CXX0030: Error: expression cannot be evaluated
At first I was getting an assertion failure in the MFC code, in
COccManager::CreateDlgControls, on the following lines :
if(pOccDlgInfo->m_pItemInfo[i].nId)
{
COleControlSiteOrWnd *pTemp = new COleControlSiteOrWnd(::GetDlgItem
(pWndParent->GetSafeHwnd(), pOccDlgInfo->m_pItemInfo[i].nId),
pOccDlgInfo->m_pItemInfo[i].bAutoRadioButton);
ASSERT(pTemp->m_hWnd);
}
After a couple of reruns it became an access violation.
The interesting part is that if I switch to a non german regional setting
and load the german resources file, it works.
Once the regional settings are set to german loading any language resource
file produces the same failure on DoModal.
I've compared the build configuration settings and the rc file to the other
languages and their rc and definitions.
It's all the same besides the language setting parts...
Any ideas ?
What to look for ?
Can it be a problem with the german language pack installtion ???
Issue #2
The other problem is for all the languages :
One of the ctrls of the dialog is an ATL Composite Ctrl which comes from
another project. It is supposed to show the text TEXT.
What happens is that my dialog shows the language extension, according to
the culture in my regional settings, right before that text:
<fr>TEXT
or
<ru>TEXT
Where does that come from ? How do I get rid of that ?
--
Thank you!!!
Similar Threads
-
By Mike Tsakiris in forum .NET
Replies: 11
Last Post: 10-04-2002, 05:32 PM
-
By FloridaSteve in forum Database
Replies: 1
Last Post: 12-11-2001, 08:02 PM
-
By Jason Thorn in forum .NET
Replies: 8
Last Post: 02-12-2001, 12:03 PM
-
By Blither in forum Database
Replies: 3
Last Post: 01-14-2001, 01:09 PM
-
By Andy in forum VB Classic
Replies: 0
Last Post: 12-30-2000, 05:24 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks