WPCubed Product Support

WpTools5 Localization with C++Builder

Hi Julian,

i try to Localize WpTools5 (using C++Builder 5) following your manuals but i have an error at compile time.
Here my lines of code:

WPLanguageControl1->Clear();
      WPLanguageControl1->LoadFromFile(XMLFileName);

      WPLangInterface = new TWPLocalizationInterface(WPLanguageControl1);

      WPLanguageControl1->GlobalLanguage = LangID;
      WPLocalizeLoadForms = true;                                 
      WPTools_LoadVCLStrings();                                   
      WPTools_LoadActionStrings();

And this are the error:

[C++ Error] IdeaWp2M.cpp(170): E2285 Could not find a match for 'TWPLocalizationInterface::TWPLocalizationInterface(TWPLanguageControl *)'

What i must change ?

#1 ♥ 0
9.1k Views 3 users read 4 min
support

Hi,

you need to remove the package wpshared and activate the define INCLUDE_WPSHARED in WPINC.INC. Then compile the wptools package.

Julian Ziersch

#2 ♥ 0

Hi,

i try your tip but C++Builder compilation error are alwais the same.

I clean up all obj, hpp, bpl, lib, bpi, etcc... from WpTools5 directory and Borland/Projects... direcotry for verify that only WpTools5 package are created, and this it's right now.
I have also verified my projects file (in ascii) and it's ok, but my program don't compile.

Another problem, with v.5.1.14 version when i execute:

WPParagraphBorderDlg1->Execute();

i see this error:

Error reading cbxShading->ItemIndex: Property does not exist.

#3 ♥ 0

Hi!

I placed an TWPLanguageControl *wpLngControl into an TDataModule,
which is initialized first when the app starts:

#include <vcl.h>
#pragma hdrstop

#include "D_DocLang.h"

#include "WPUtil.hpp"
#include "WPActnStr.hpp"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TdmdDocLang *dmdDocLang = NULL;
//---------------------------------------------------------------------------
__fastcall TdmdDocLang::TdmdDocLang(TComponent* Owner)
: TDataModule(Owner)
{
   WPLangInterface = NULL;
   wpLngControl->Active = true;

   WPLangInterface = new TWPLocalizationInterface( (IUnknown*)*wpLngControl );
   SetLanguage( 0 );
}
//---------------------------------------------------------------------------
__fastcall TdmdDocLang::~TdmdDocLang(void)
{
   delete WPLangInterface;
   WPLangInterface = NULL;
}
//---------------------------------------------------------------------------
bool __fastcall TdmdDocLang::SetLanguage( int lng )
{
   bool Ok = false;
   AnsiString WPLng, LocStr;

   switch( lng ) {
      case  0:
      case  1: WPLng = "DE"; break;
      case  2: WPLng = "FR"; break;
      default: WPLng = "EN"; break;
   }

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

   return( Ok );
}

Kind regards,
E. Hess

#4 ♥ 0

Error reading cbxShading->ItemIndex: Property does not exist.

I guess you use BCB 5 as I do.
cbxShading's ItemIndex got a published property since Delphi / BCB 6, in Delphi / BCB 5 it is not a property. In one of the past WPTools version, Julian reset the ItemIndex to the default value to not appear in the DFM file.
Unfortunately, the latest WPTools version again had the ItemIndex set to another value instead of the default value.
The problem is, that this is NOT reported by the compiler but first at runtime, so you will not know, whether the WPTools windows (forms) will really work :-(

WPCubed should set the cbxShading's ItemIndex to the default value, otherwise you have to remove it yourself out of WpParBrd.dfm.

Best regards,
E. Hess

#5 ♥ 0

Another problem, with v.5.1.14 version when i execute:
WPParagraphBorderDlg1->Execute();

Works again with v5.17.4

Kind regards,
E. Hess

#6 ♥ 0

Hi,

thank you for your tips.
I solved C++Builder 5 compiler error and localization now work fine.

About

Error reading cbxShading->ItemIndex: Property does not exist.

i'm use WpTools5 v.5.17.4 (sorry for typing error in my previous post) and WPParagraphBorderDlg1->Execute(); don't work.

I see in WpParBrd.dfm and i found this lines:

object cbxShading: TWPComboBox
    Left = 96
    Top = 149
    Width = 58
    Height = 22
    Style = csOwnerDrawFixed
    ItemHeight = 16
    ItemIndex = 0
    TabOrder = 2
    Text = '0'
    OnChange = cbxShadingChange

please Julian solve also this problem in your next version.

#7 ♥ 0
support

Hi,

I usually search for 'ItemIndex' in the DFM files - they are sometimes inserted when I open and change a form with Delphi 7. Not a big deal to fix it since the DFM are in text format anyways.

Julian

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