WPCubed Product Support

TWPLocalizationInterface & Builder C++ 6

Hello !

I try to use the localization with Builder C++.

In delphi, it is :

// requires unit WPUtils and WPActnStr
WPLangInterface := TWPLocalizationInterface.Create(WPLanguageControl1);
WPLanguageControl1.GlobalLanguage := 'DE';
WPLocalizeLoadForms := TRUE;
WPTools_LoadVCLStrings;
WPTools_LoadActionStrings;

In C++, i translate like this :

// requires unit WPUtils and WPActnStr
WPLangInterface = new TWPLocalizationInterface(WPLanguageControl1); //WPTOOLS5
WPLanguageControl1->GlobalLanguage = "DE";
WPLocalizeLoadForms = TRUE; //WPTOOLS5
WPTools_LoadVCLStrings(); //WPTOOLS5
WPTools_LoadActionStrings(); //WPTOOLS5

On the first line :
WPLangInterface = new TWPLocalizationInterface(WPLanguageControl1);

Construction
[C++ Erreur] xxxxxx.cpp(2😎: E2285 Impossible de trouver une correspondance pour 'TWPLocalizationInterface::TWPLocalizationInterface(TWPLanguageControl *)'

in english :

Impossible to find this prototype 'TWPLocalizationInterface::TWPLocalizationInterface(TWPLanguageControl *)'

Have you a solution or/and an example in C++ ?

François
:wink:

#1 ♥ 0
6.1k Views 3 users read 2 min
support

Hi,

it used to work C++Builder 5.

WPLangInterface := TWPLocalizationInterface.Create(WPLanguageControl1);

calls up
constructor Create(WPLocalizationInterface: IUnknown);

this means it uses the COM interface implemented by

TWPLanguageControl = class(TWPCustomXMLTree, IWPLocalizationInterface, IUnknown)

I cannot say why this does not work.

Hardcoding this in one of the pascal units in the initialization part (atr end of unit) helps, but is no real solution.

Julian

#2 ♥ 0

In C++Builder 5 this worked:

WPLangInterface = new TWPLocalizationInterface( (IUnknown*)*WPLanguageControl1);

Kind regards,
E. Hess

#3 ♥ 0

In C++ Builder 6,

it is :

WPLangInterface = new TWPLocalizationInterface((System::_di_IInterface)*WPLanguageControl1);

Compilation is ok ...

I still have no translation ! i'm working ...

#4 ♥ 0

Hmm!

I use this code (BTW, in a DataModule's constructor):

WPLanguageControl1->Active = true;
WPLangInterface = new TWPLocalizationInterface( (IUnknown*)*WPLanguageControl1 );

WPLng = "DE";
LocStr = "/" + WPLanguageControl1->XMLParent + "/" + WPLng;
if (WPLanguageControl1->Find( LocStr ) != NULL) {
WPLanguageControl1->GlobalLanguage = WPLng;
WPLocalizeLoadForms = true;
WPTools_LoadVCLStrings();
WPTools_LoadActionStrings();
GlobalValueUnit = euCm;
}

Please check:

  1. WPLanguageControl1->Active = true ?
  2. To be sure, use 'true', not 'TRUE'.
  3. Is WPLanguageControl1's XML-Tree filled with the DE-translations?

Kind regards,
E. Hess

#5 ♥ 0
This category is archived. No new posts are possible.