Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Switching back to CP_ACP instead of CP_THREAD_ACP

333 views
Skip to first unread message

Reuven Nisser

unread,
Jan 20, 2008, 7:39:28 AM1/20/08
to
Hi,
MFC conversions between Unicode and non-Unicode pages are done now using
CP_THREAD_ACP instead of CP_ACP. Is there a way to change back to CP_ACP?

I tried defining _CONVERSION_DONT_USE_THREAD_LOCALE but it does not
apply to MFC DLL. I do not want to re-compile the DLL and redistribute it.

I tried changing the pointer g_pfnGetThreadACP (atlconv.h) to point to a
routine returning CP_ACP. However, it seems my program contains a
different variable g_pfnGetThreadACP than the one MFC uses. Maybe
there's a way to link to MFC variable?

From programming point of view, is there a way to change CP_THREAD_ACP?
I mean changing the "ANSI code page for the current thread"? I checked
SetThreadLocale() and it seems to do much more than I need. In fact, too
much. I only need to change CP_THREAD_ACP and not the rest of the locale
settings.

Thanks,
Reuven Nisser

Mihai N.

unread,
Jan 20, 2008, 3:17:27 PM1/20/08
to
> I mean changing the "ANSI code page for the current thread"? I checked
> SetThreadLocale() and it seems to do much more than I need. In fact, too
> much. I only need to change CP_THREAD_ACP and not the rest of the locale
> settings.
SetThreadLocale is the one. What is the "much more" than botthers you?


--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

Reuven Nisser

unread,
Jan 21, 2008, 10:55:29 AM1/21/08
to Mihai N.
Hi Mihai,
Yes, you are right. I thought it changes one of the GetLocaleInfo()
returns but it does not. So actually, the function only changes
CP_THREAD_ACP.
Thanks, Reuven

Reuven Nisser

unread,
Jan 21, 2008, 10:55:48 AM1/21/08
to
0 new messages