Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages
Started by Mike Collins
Fri, 02 Feb 2007 21:37
TLanguage & EAccessViolation
Author: Mike Collins
Date: Fri, 02 Feb 2007 21:37
Date: Fri, 02 Feb 2007 21:37
52 lines
2604 bytes
2604 bytes
Hay all, posted a message the other day regarding a bug I was chasing that I
though was cause by a call to CoInitialize. Tracked it down and it has
nothing to do with it.
After careful delving, I found that the EAccessViolation error is stemming
from some code used to display the default system language. The exception
is raised when I either try to get a point to the global TLanguage object or
dynamically creating a new one. It currently only seem to occur when the
code / GINA is run on Windows systems that has English (United States), LCID
0x0409, as there default system language. It does not happen on English
(UK) or any other European locales.
Please note that the GINA / my code is running under the winlogon desktop
and LOCAL_SYSTEM.
The other anomaly is that if I extract the below code, and sick it in a demo
application and run that on the users desktop, it functions correctly:
TLanguages *lang = NULL;
try
{
try
{
lang = new TLanguages(); //*******<- point of exception
//lang = Languages(); //****** either option cause
excpetion
LCID udlc = GetSystemDefaultLCID();
for (short i=0; i<lang->Count; ++i)
{
if (lang->LocaleID[i] == udlc)
{
panSysLang->Caption = lang->Ext[i].SubString(0, 2);
panSysLang->Hint =
GinaStub->RtnSz(HELP_OPT_CONFIG_HEADER_SYS_LANG_HINT);
panSysLang->Hint =
AnsiString().sprintf(panSysLang->Hint.c_str(), lang->Name[i].c_str());
}
}
}
catch (std::bad_alloc)
{
}
}
__finally
{
if (lang)
{
delete lang;
lang = NULL;
}
}
Re: TLanguage & EAccessViolation
Author: Mike Collins
Date: Mon, 12 Feb 2007 12:50
Date: Mon, 12 Feb 2007 12:50
19 lines
1730 bytes
1730 bytes
In the interest of clarity, I believe I've found the problem. these links seem to suggest that there is an issue with TLanguages VCL and DEP on certain processors. I don't know if this is exactly the problem that i'm experiencing but it sound similar. Anyway, I've replaced the buggy VCL with API calls and all works fine now. http://qc.borland.com/wc/qcmain.aspx?d=12151 http://cc.codegear.com/Item.aspx?id=23411 http://groups.google.co.uk/group/borland.public.delphi.non-technical/browse_thread/thread/b4f0977893f2a605/4f3e32df50463017?lnk=st&q=TLanguages&rnum=4&hl=en "Mike Collins" <its@TheBottomOfThePost.com> wrote in message news:45c3aed7@newsgroups.borland.com... > Hay all, posted a message the other day regarding a bug I was chasing that > I
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads