Page 1 of 1

siLang data mod initialization

Posted: Thu Mar 15, 2007 9:53 pm
by DavidD
We have placed both both the siLangDispatcher and siLang components in an otherwise empty data mod called dmInternational. It is auto-created before any other form. However, several of our non-visual units reference GetTextordefault and MessageDlg and they have initialization code sections. This combination generates a 216 error.

I have worked around this by having dmInternational create itself in its own initialization code section and moving it to the top of the uses list in the DPR file after the Borland units and before any of our units.

Is there a more elegant solution?

Thanks again

Posted: Fri Mar 16, 2007 3:56 am
by isiticov
Hello,

No, this is the most correct way for this situation (if you initialize strings in initialization section). But you can just modify a little your code by initializing these strings inside OnCreate event of this data module and then you won't need to check all the time the order of listed units in your project source.