LoadString overwrite

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hello,

we are just trying to migrate our application from VC6.0 to VC2005.

In our application we have overloaded CString::LoadString (by making
sure that the linker uses our function before linking MFC42.lib) for
doing some special string replacements.
This means that we have tags in the string resources which are replaced
at runtime.

In MFC 8.0 the CString class is a template class and I couldn't figure
out a possibility to overwrite CString::LoadString(UINT nID).
Overloading it, you get a C2084 (explicit specialization; 'template'
has already been instantiated) error message, and there is no chance to
define the function before the template instatiation (which is done in
afxstr.h).

Any idea?

Thanks,
Gerhard.

.



Relevant Pages

  • Re: LoadString overwrite
    ... doing some special string replacements. ... In MFC 8.0 the CString class is a template class and I couldn't figure ... Overloading it, you get a C2084 (explicit specialization; ...
    (microsoft.public.vc.mfc)
  • Re: LoadString overwrite
    ... CString as a member of another class and do it that way. ... doing some special string replacements. ... In MFC 8.0 the CString class is a template class and I couldn't figure ... Overloading it, you get a C2084 (explicit specialization; ...
    (microsoft.public.vc.mfc)
  • Re: LoadString overwrite
    ... In MFC 8.0 the CString class is a template class and I couldn't figure ... Overloading it, you get a C2084 (explicit specialization; ... You might try suppressing the instantiation using the "extern template" ... play linker games to replace member functions. ...
    (microsoft.public.vc.mfc)
  • Re: generic programming is very powerful. c should support it
    ... If you make the template parameters part of the function's name, ... If there is a fully specialized template for these parameters, ... from interactions with overloading and inheritance. ...
    (comp.lang.c)
  • Re: Help: How many explicit specializations required?
    ... > non template functions are overloadable ... specialization of the primary template. ... I think the above case is a partial ordering (overloading of the ... instantiation will be entered into the list of candidate functions. ...
    (comp.lang.cpp)