Click here to Skip to main content
15,885,896 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Custom Tool Bar Event Handler Pin
BlitzPackage24-Jan-06 0:03
BlitzPackage24-Jan-06 0:03 
GeneralRe: Custom Tool Bar Event Handler Pin
Owner drawn24-Jan-06 0:11
Owner drawn24-Jan-06 0:11 
GeneralRe: Custom Tool Bar Event Handler Pin
BlitzPackage24-Jan-06 2:05
BlitzPackage24-Jan-06 2:05 
GeneralRe: Custom Tool Bar Event Handler Pin
Owner drawn24-Jan-06 16:49
Owner drawn24-Jan-06 16:49 
QuestionVariable Baud Rate Pin
IceBerG7123-Jan-06 15:33
IceBerG7123-Jan-06 15:33 
AnswerRe: Variable Baud Rate Pin
Ryan Binns23-Jan-06 17:10
Ryan Binns23-Jan-06 17:10 
AnswerRe: Variable Baud Rate Pin
normanS23-Jan-06 18:41
normanS23-Jan-06 18:41 
QuestionDoModal throws an access violation only for one language Pin
A_L23-Jan-06 13:19
A_L23-Jan-06 13:19 
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!
Questionkeyboard event during long lasting loop Pin
wpuelm23-Jan-06 12:45
wpuelm23-Jan-06 12:45 
AnswerRe: keyboard event during long lasting loop Pin
Blake Miller23-Jan-06 12:57
Blake Miller23-Jan-06 12:57 
AnswerRe: keyboard event during long lasting loop Pin
Michael Dunn23-Jan-06 17:13
sitebuilderMichael Dunn23-Jan-06 17:13 
GeneralRe: keyboard event during long lasting loop Pin
Rajesh R Subramanian23-Jan-06 18:27
professionalRajesh R Subramanian23-Jan-06 18:27 
AnswerRe: keyboard event during long lasting loop Pin
namaskaaram23-Jan-06 18:47
namaskaaram23-Jan-06 18:47 
QuestionHow to define a global object Pin
xyhan23-Jan-06 11:29
xyhan23-Jan-06 11:29 
AnswerRe: How to define a global object Pin
Stephen Hewitt23-Jan-06 11:35
Stephen Hewitt23-Jan-06 11:35 
GeneralRe: How to define a global object Pin
xyhan23-Jan-06 11:49
xyhan23-Jan-06 11:49 
AnswerRe: How to define a global object Pin
Blake Miller23-Jan-06 12:22
Blake Miller23-Jan-06 12:22 
Question.NET's "function collapse" feature for VC6? Pin
__yb23-Jan-06 11:07
__yb23-Jan-06 11:07 
AnswerRe: .NET's "function collapse" feature for VC6? Pin
Owner drawn23-Jan-06 16:46
Owner drawn23-Jan-06 16:46 
QuestionShare data between objects. Pin
xyhan23-Jan-06 11:05
xyhan23-Jan-06 11:05 
AnswerRe: Share data between objects. Pin
__yb23-Jan-06 11:08
__yb23-Jan-06 11:08 
GeneralRe: Share data between objects. Pin
xyhan23-Jan-06 11:18
xyhan23-Jan-06 11:18 
GeneralRe: Share data between objects. Pin
Stephen Hewitt23-Jan-06 12:22
Stephen Hewitt23-Jan-06 12:22 
GeneralRe: Share data between objects. Pin
Blake Miller23-Jan-06 12:25
Blake Miller23-Jan-06 12:25 
GeneralRe: Share data between objects. Pin
Stephen Hewitt23-Jan-06 12:30
Stephen Hewitt23-Jan-06 12:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.