PATCHWISE.COM
The Creative Development Company
  Log in to check your private messagesLog in to check your private messages   Log inLog in 
  PatchWise Software Community ...................................................................................................................
FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile 

LcwAfxFormatString ... maximum of 2 parameters a limitation

 
Post new topic   Reply to topic    PatchWise Software Community Forum Index -> LocWise Multilingual SDK Support
View previous topic :: View next topic  
Author Message
Alcatel_01



Joined: 10 Apr 2003
Posts: 7

PostPosted: Jun 17, 2003 11:32 am    Post subject: LcwAfxFormatString ... maximum of 2 parameters a limitation Reply with quote

When trasferring hard-coded strings from our application to the resource file, I have noticed that several of them contain 3 or more parameters which require substitution. However, the LcwAfxFormatString family of functions allows at most 2 parameters to be substituted per string/resource ID.

One way around this limitation is to divide each string in the resource file into substrings which each contain at most 2 parameters. Is there a more elegant solution? Will this issue be addressed in future releases of LocWise?
Back to top
View user's profile Send private message
Support
Site Admin


Joined: 03 Nov 2002
Posts: 118

PostPosted: Jun 17, 2003 9:18 pm    Post subject: Reply with quote

You can use LcwAfxFormatStrings function, unlimited parameters can be substituted per string/resource ID.

Please check LocWise function reference for the detail.

Sample of usage:
Code:
...
LPCTSTR rglpsz[3];
rglpsz[0] = lpsz1;
rglpsz[1] = lpsz2;
rglpsz[2] = lpsz3;
LcwAfxFormatStrings(rString, nIDS, rglpsz, 3);
...


or

Code:
...
UINT rgnIDS[3];
rgnIDS[0] = nIDS1;
rgnIDS[1] = nIDS2;
rgnIDS[2] = nIDS3;
LcwAfxFormatStrings(rString, nIDS, rgnIDS, 3);
...

rString
[out] A reference to a CString object that will contain the resultant string after the substitution is performed.

nIDS
[in] The resource ID of the template string on which the substitution will be performed.

lpsz1
[in] A string that will replace the format characters "%1" in the template string.

lpsz2
[in] A string that will replace the format characters "%2" in the template string.

...

nIDS1
[in] The resource ID of the sub-string that will replace the format characters "%1" in the template string.

nIDS2
[in] The resource ID of the sub-string that will replace the format characters "%2" in the template string.

...
_________________
At Your Service
The PatchWise Software Support Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    PatchWise Software Community Forum Index -> LocWise Multilingual SDK Support All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Powered by phpBB © 2001, 2002 phpBB Group
 
©  2002 Hanmen Software, Inc. All rights reserved.  | Terms of Use | Privacy Statement