www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - resource_string

reply "Pablo Aguilar" <paguilarg hotmail.com> writes:
Is there or will there be a resource_string that's not dependant on MFC?
May 21 2004
parent reply "Matthew" <matthew.hat stlsoft.dot.org> writes:
There's basic_resource_string in winstl_resource_string.h, which is in the
inprogress directory. I've been using this myself a lot recently (in the shell
extensions just updated at http://shellext.com) and will promote this to the
main
directory for 1.7.1.

It requires a base string to use, e.g. std::string, and you can supply an
exception policy type (otherwise it uses stlsoft::null_exception, which does not
throw, and the string is just empty on failure).

Beware that it does not yet work for UNICODE, but I will make this work before
1.7.1 (which I am hoping to release in the next few days ...).

Good reminder! :-)

"Pablo Aguilar" <paguilarg hotmail.com> wrote in message
news:c8lk6v$r7m$1 digitaldaemon.com...
 Is there or will there be a resource_string that's not dependant on MFC?
May 21 2004
parent reply "Matthew" <matthew.hat stlsoft.dot.org> writes:
I've done it, and added in unit testing (and tested it!). Here's a sneak
preview.

Note: It does work with UNICODE. I was blowing hot air. ;)

"Matthew" <matthew.hat stlsoft.dot.org> wrote in message
news:c8lnhp$10ei$1 digitaldaemon.com...
 There's basic_resource_string in winstl_resource_string.h, which is in the
 inprogress directory. I've been using this myself a lot recently (in the shell
 extensions just updated at http://shellext.com) and will promote this to the
main
 directory for 1.7.1.

 It requires a base string to use, e.g. std::string, and you can supply an
 exception policy type (otherwise it uses stlsoft::null_exception, which does
not
 throw, and the string is just empty on failure).

 Beware that it does not yet work for UNICODE, but I will make this work before
 1.7.1 (which I am hoping to release in the next few days ...).

 Good reminder! :-)

 "Pablo Aguilar" <paguilarg hotmail.com> wrote in message
 news:c8lk6v$r7m$1 digitaldaemon.com...
 Is there or will there be a resource_string that's not dependant on MFC?
begin 666 winstl_resource_string.h M+RH +R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+PT*("H 1FEL93H M(" (" ('=I;G-T;%]R97-O=7)C95]S=')I;F<N:" H1F]R;65R;'D 35=2 M97-3='(N:#H .CI3>6YE<VES5VEN*0T*("H-"B J(%!U<G!O<V4Z(" ("!B M87-I8U]R97-O=7)C95]S=')I;F< 8VQA<W,N#0H * T*("H 0W)E871E9#H M(" (#%S="!.;W9E;6)E<B Q.3DT#0H *B!5<&1A=&5D.B (" ,C)N9"!- M87D ,C P- T*("H-"B J($%U=&AO<CH (" ("!-871T:&5W(%=I;'-O;BP M4WEN97-I<R!3;V9T=V%R92!0='D 3'1D+ T*("H-"B J($QI8V5N<V4Z(" M(" H3&EC96YS960 =6YD97( =&AE(%-Y;F5S:7, 4V]F='=A<F4 4W1A;F1A M<F0 4V]U<F-E($QI8V5N<V4I#0H * T*("H (" (" (" (" ($-O<'ER M:6=H=" H0RD ,C P,BTR,# T+"!3>6YE<VES(%-O9G1W87)E(%!T>2!,=&0N M#0H * T*("H (" (" (" (" ($%L;"!R:6=H=', <F5S97)V960N#0H M* T*("H (" (" (" (" ('=W=SH (" (" (&AT=' Z+R]W=W<N<WEN M97-I<RYC;VTN874O=VEN<W1L#0H *B (" (" (" (" (" (" (" M(" :'1T<#HO+W=W=RYW:6YS=&PN;W)G+PT*("H-"B J(" (" (" (" M("!E;6%I;#H (" ("!S=6)M:7-S:6]N<T!W:6YS=&PN;W)G("!F;W( <W5B M;6ES<VEO;G,-"B J(" (" (" (" (" (" (" (" ("!A9&UI;D!W M:6YS=&PN;W)G(" (" ("!F;W( ;W1H97( 96YQ=6ER:65S#0H * T*("H M(" (" (" (" (%)E9&ES=')I8G5T:6]N(&%N9"!U<V4 :6X <V]U<F-E M(&%N9"!B:6YA<GD 9F]R;7,L('=I=& ;W(-"B J(" (" (" (" ("!W M:71H;W5T(&UO9&EF:6-A=&EO;BP 87)E('!E<FUI='1E9"!P<F]V:61E9"!T M:&%T('1H92!F;VQL;W=I;F<-"B J(" (" (" (" ("!C;VYD:71I;VYS M(&%R92!M970Z#0H * T*("H (" (" (" (" ("AI*2!2961I<W1R:6)U M=&EO;G, ;V8 <V]U<F-E(&-O9&4 ;75S="!R971A:6X =&AE(&%B;W9E#0H M*B (" (" (" (" 8V]P>7)I9VAT(&YO=&EC92!A;F0 8V]N=&%C="!I M;F9O<FUA=&EO;BP =&AI<R!L:7-T(&]F#0H *B (" (" (" (" 8V]N M9&ET:6]N<R!A;F0 =&AE(&9O;&QO=VEN9R!D:7-C;&%I;65R+ T*("H-"B J M(" (" (" (" (" H:6DI($%N>2!D97)I=F5D('9E<G-I;VYS(&]F('1H M:7, <V]F='=A<F4 *&AO=W-O979E<B!M;V1I9FEE9"D-"B J(" (" (" M(" ("!R96UA:6X =&AE('-O;&4 <')O<&5R='D ;V8 4WEN97-I<R!3;V9T M=V%R92X-"B J#0H *B (" (" (" (" *&EI:2D 06YY(&1E<FEV960 M=F5R<VEO;G, ;V8 =&AI<R!S;V9T=V%R92 H:&]W<V]E=F5R(&UO9&EF:65D M*0T*("H (" (" (" (" (')E;6%I;B!S=6)J96-T('1O(&%L;"!T:&5S M92!C;VYD:71I;VYS+ T*("H-"B J(" (" (" (" (" H:78I($YE:71H M97( =&AE(&YA;64 ;V8 4WEN97-I<R!3;V9T=V%R92!N;W( =&AE(&YA;65S M(&]F(&%N>0T*("H (" (" (" (" ('-U8F1I=FES:6]N<RP 96UP;&]Y M965S(&]R(&%G96YT<R!O9B!3>6YE<VES(%-O9G1W87)E+"!N;W( =&AE#0H M*B (" (" (" (" ;F%M97, ;V8 86YY(&]T:&5R(&-O;G1R:6)U=&]R M<R!T;R!T:&ES('-O9G1W87)E(&UA>2!B92!U<V5D('1O#0H *B (" (" M(" (" 96YD;W)S92!O<B!P<F]M;W1E('!R;V1U8W1S(&1E<FEV960 9G)O M;2!T:&ES('-O9G1W87)E('=I=&AO=70-"B J(" (" (" (" ("!S<&5C M:69I8R!P<FEO<B!W<FET=&5N('!E<FUI<W-I;VXN#0H * T*("H (" (" M(" (" (%1H:7, <V]U<F-E(&-O9&4 :7, <')O=FED960 8GD 4WEN97-I M<R!3;V9T=V%R92 B87, :7,B(&%N9"!A;GD-"B J(" (" (" (" ("!W M87)R86YT:65S+"!W:&5T:&5R(&5X<')E<W-E9"!O<B!I;7!L:65D+"!I;F-L M=61I;F<L(&)U="!N;W0-"B J(" (" (" (" ("!L:6UI=&5D('1O+"!T M:&4 :6UP;&EE9"!W87)R86YT:65S(&]F(&UE<F-H86YT86)I;&ET>2!A;F0- M"B J(" (" (" (" ("!F:71N97-S(&9O<B!A('!A<G1I8W5L87( <'5R M<&]S92!A<F4 9&ES8VQA:6UE9"X 26X ;F\ 979E;G0-"B J(" (" (" M(" ("!S:&%L;"!T:&4 4WEN97-I<R!3;V9T=V%R92!B92!L:6%B;&4 9F]R M(&%N>2!D:7)E8W0L(&EN9&ER96-T+ T*("H (" (" (" (" (&EN8VED M96YT86PL('-P96-I86PL(&5X96UP;&%R>2P ;W( 8V]N<V5Q=65N=&EA;"!D M86UA9V5S#0H *B (" (" (" (" *&EN8VQU9&EN9RP 8G5T(&YO="!L M:6UI=&5D('1O+"!P<F]C=7)E;65N="!O9B!S=6)S=&ET=71E(&=O;V1S#0H M*B (" (" (" (" ;W( <V5R=FEC97,[(&QO<W, ;V8 =7-E+"!D871A M+"!O<B!P<F]F:71S.R!O<B!B=7-I;F5S<PT*("H (" (" (" (" (&EN M=&5R<G5P=&EO;BD :&]W979E<B!C875S960 86YD(&]N(&%N>2!T:&5O<GD M;V8 ;&EA8FEL:71Y+ T*("H (" (" (" (" ('=H971H97( :6X 8V]N M=')A8W0L('-T<FEC="!L:6%B:6QI='DL(&]R('1O<G0 *&EN8VQU9&EN9PT* M("H (" (" (" (" (&YE9VQI9V5N8V4 ;W( ;W1H97)W:7-E*2!A<FES M:6YG(&EN(&%N>2!W87D ;W5T(&]F('1H92!U<V4 ;V8-"B J(" (" (" M(" ("!T:&ES('-O9G1W87)E+"!E=F5N(&EF(&%D=FES960 ;V8 =&AE('!O M<W-I8FEL:71Y(&]F('-U8V -"B J(" (" (" (" ("!D86UA9V4N#0H M* T*("H +R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\ *B\-" T*#0HC M:69N9&5F(%]724Y35$Q?24Y#3%](7U=)3E-43%]215-/55)#15]35%))3D<- M"B-D969I;F4 7U=)3E-43%])3D-,7TA?5TE.4U1,7U)%4T]54D-%7U-44DE. M1PT*#0HC:69N9&5F(%]?4U1,4T]&5%]$3T-5345.5$%424].7U-+25!?4T5# M5$E/3 T*(R!D969I;F4 7U=)3E-43%]615)?2%]724Y35$Q?4D533U520T5? M4U1224Y'7TU!2D]2(" (" Q#0HC(&1E9FEN92!?5TE.4U1,7U9%4E](7U=) M3E-43%]215-/55)#15]35%))3D=?34E.3U( (" (#4-"B, 9&5F:6YE(%]7 M24Y35$Q?5D527TA?5TE.4U1,7U)%4T]54D-%7U-44DE.1U]2159)4TE/3B M,0T*(R!D969I;F4 7U=)3E-43%]615)?2%]724Y35$Q?4D533U520T5?4U12 M24Y'7T5$250 (" (" R- T*(V5N9&EF("\J("%?7U-43%-/1E1?1$]#54U% M3E1!5$E/3E]32TE07U-%0U1)3TX *B\-" T*+RH +R\O+R\O+R\O+R\O+R\O M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O+R\O+R\O+R\O+R\O+R\-"B J($EN8VQU9&5S#0H *B\-" T*(VEF;F1E M9B!?5TE.4U1,7TE.0TQ?2%]724Y35$P-"B, :6YC;'5D92 B=VEN<W1L+F B M(" (" (" (" (" ("\O($EN8VQU9&4 =&AE(%=I;E-43"!R;V]T(&AE M861E< T*(V5N9&EF("\J("%?5TE.4U1,7TE.0TQ?2%]724Y35$P *B\-"B-I M9FYD968 7U-43%-/1E1?24Y#3%](7U-43%-/1E1?4U1224Y'7U1204E44PT* M(R!I;F-L=61E(")S=&QS;V9T7W-T<FEN9U]T<F%I=',N:"( +R\ <W1L<V]F M=#HZ<W1R:6YG7W1R86ET<PT*(V5N9&EF("\J("%?4U1,4T]&5%])3D-,7TA? M4U1,4T]&5%]35%))3D=?5%)!2513("HO#0HC:69N9&5F(%]35$Q33T947TE. M0TQ?2%]35$Q33T947T580T505$E/3E,-"B, :6YC;'5D92 B<W1L<V]F=%]E M>&-E<'1I;VYS+F B(" ("\O('-T;'-O9G0Z.FYU;&Q?97AC97!T:6]N#0HC M96YD:68 +RH (5]35$Q33T947TE.0TQ?2%]35$Q33T947T580T505$E/3E, M*B\-"B-I9F1E9B!35$Q33T947U5.251415-4#0HC(&EN8VQU9&4 /'-T<FEN M9SX (" (" (" (" (" (" O+R!S=&0Z.G-T<FEN9RP <W1D.CIW<W1R M:6YG#0HC96YD:68 +RH 4U1,4T]&5%]53DE45$535" J+PT*#0HO*B O+R\O M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+PT*("H 3F%M97-P86-E#0H M*B\-" T*(VEF;F1E9B!?5TE.4U1,7TY/7TY!34534$%#10T*(R!I9F1E9B!? M4U1,4T]&5%].3U].04U%4U!!0T4-"B\J(%1H97)E(&ES(&YO('-T;'-O9G0 M;F%M97-P86-E+"!S;R!M=7-T(&1E9FEN92 Z.G=I;G-T;" J+PT*;F%M97-P M86-E('=I;G-T; T*>PT*(R!E;'-E#0HO*B!$969I;F4 <W1L<V]F=#HZ=VEN M<W1L7W!R;VIE8W0 *B\-" T*;F%M97-P86-E('-T;'-O9G0-"GL-" T*;F%M M97-P86-E('=I;G-T;%]P<F]J96-T#0I[#0H-"B, 96YD:68 +RH 7U-43%-/ M1E1?3D]?3D%-15-004-%("HO#0HC96YD:68 +RH (5]724Y35$Q?3D]?3D%- M15-004-%("HO#0H-"B\J("\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R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1R:6YG+"!S=&QS;V9T.CIS M:6UP;&5?<W1R:6YG+"!E=&,N#0HO+R\ 7'!A<F%M(% 5&AE(&5X8V5P=&EO M;B!C;&%S<PT*=&5M<&QA=&4\(" <W-?='EP96YA;65?<&%R86U?:R!3#0HC M:69D968 7U]35$Q33T947T-&7U1%35!,051%7T-,05-37T1%1D%53%1?0TQ! M4U-?05)'54U%3E1?4U504$]25 T*(" (" (" L(" <W-?='EP96YA;65? M<&%R86U?:R!8(#T <W1L<V]F=%]N<U]Q=6%L*&YU;&Q?97AC97!T:6]N*0T* M+R\ (" (" L(" <W-?='EP96YA;65?<&%R86U?:R!#(#T <W-?='EP96YA M;65?='EP95]D969?:R!3.CIV86QU95]T>7!E#0HO+R, :68 (61E9FEN960H M7U-43%-/1E1?3D]?3D%-15-004-%*2 F)B!<#0HO+R (" (61E9FEN960H M7U-43%-/1E1?4TE-4$Q%7U-44DE.1U].3U]54T5?4U1,4T]&5%]#2$%27U12 M04E44RD-"B\O(" (" (" L(" <W-?='EP96YA;65?<&%R86U?:R!4(#T M<W1L<V]F=%]N<U]Q=6%L*&-H87)?=')A:71S*3Q#/ T*+R\C(&5L<V4-"B\O M(" (" (" L(" <W-?='EP96YA;65?<&%R86U?:R!4(#T <W1L<V]F=%]N M<U]Q=6%L7W-T9"AC:&%R7W1R86ET<RD\0SX-"B\O(R!E;F1I9B O*B A7U-4 M3%-/1E1?3D]?3D%-15-004-%("8F("%?4U1,4T]&5%]324U03$5?4U1224Y' M7TY/7U5315]35$Q33T947T-(05)?5%)!2513("HO#0HC96QS92 O*B _(%]? M4U1,4T]&5%]#1E]414U03$%415]#3$%34U]$149!54Q47T-,05-37T%21U5- M14Y47U-54%!/4E0 *B\-"B (" (" +" ('-S7W1Y<&5N86UE7W!A<F%M M7VL 6" O*B ]('-T;'-O9G1?;G-?<75A;"AN=6QL7V5X8V5P=&EO;BD *B\- M"B\O(" (" +" ('-S7W1Y<&5N86UE7W!A<F%M7VL 0R O*B ]('-S7W1Y M<&5N86UE7W1Y<&5?9&5F7VL 4SHZ=F%L=65?='EP92 J+PT*+R\ (" (" M("P ("!S<U]T>7!E;F%M95]P87)A;5]K(%0 +RH /2!S=&QS;V9T7VYS7W%U M86PH8VAA<E]T<F%I=',I/$,^("HO#0HC96YD:68 +RH 7U]35$Q33T947T-& M7U1%35!,051%7T-,05-37T1%1D%53%1?0TQ!4U-?05)'54U%3E1?4U504$]2 M5" J+PT*(" (" (" ^#0IC;&%S<R!B87-I8U]R97-O=7)C95]S=')I;F<- M"B (" Z('!U8FQI8R!3#0H (" +"!P<F]T96-T960 6 T*>PT*<')I=F%T M93H-"B ("!T>7!E9&5F(%, (" (" (" (" (" (" (" (" (" M(" (" (" (" ("!P87)E;G1?8VQA<W-?='EP93L-"B\O(" ('1Y<&5D M968 0R (" (" (" (" (" (" (" (" (" (" (" (" (" M('9A;'5E7W1Y<&4[#0IP=6)L:6,Z#0H (" ='EP961E9B!3(" (" (" M(" (" (" (" (" (" (" (" (" (" (" <W1R:6YG7W1Y<&4[ M#0H (" ='EP961E9B!B87-I8U]R97-O=7)C95]S=')I;F<\4RP 6#X (" M(" (" (" (" 8VQA<W-?='EP93L-"B ("!T>7!E9&5F(% (" (" M(" (" (" (" (" (" (" (" (" (" (" ("!E>&-E<'1I;VY? M='EP93L-"B ("!T>7!E9&5F('-T;'-O9G1?;G-?<75A;"AS=')I;F=?=')A M:71S*3Q3/B (" (" ("!S=')I;F=?=')A:71S7W1Y<&4[#0H (" (" M(" (" (" (" (" (" (" (" (" (" (" (" ( T*(" ('1Y M<&5D968 <W-?='EP96YA;65?='EP95]K('-T<FEN9U]T>7!E.CIV86QU95]T M>7!E('9A;'5E7W1Y<&4[#0H-"B\O+R!#;VYS=')U8W1I;VX-"B\O+R! >PT* M<'5B;&EC. T*(" ("\O+R!#;VYS=')U8W1S(&%N(&%R;W5N9"!T:&4 <W1R M:6YG(&QO861E9"!F<F]M('1H92!G:79E;B!<8R!I9 T*(" (&5X<&QI8VET M(&)A<VEC7W)E<V]U<F-E7W-T<FEN9RAW<U]I;G1?="!I9"D =&AR;W<H97AC M97!T:6]N7W1Y<&4Z.G1H<F]W;E]T>7!E*0T*(" ('L-"B (" (" ;&]A M9" Z.D=E=$UO9'5L94AA;F1L92A.54Q,*2P :60I.PT*(" ('T-" T*(" M("\O+R!#;VYS=')U8W1S(&%N(&%R;W5N9"!T:&4 <W1R:6YG(&QO861E9"!F M<F]M('1H92!G:79E;B!<8R!I9"!A;F0 7&, :&EN<W0-"B ("!B87-I8U]R M97-O=7)C95]S=')I;F<H2$E.4U1!3D-%(&AI;G-T+"!W<U]I;G1?="!I9"D M=&AR;W<H97AC97!T:6]N7W1Y<&4Z.G1H<F]W;E]T>7!E*0T*(" ('L-"B M(" (" ;&]A9"AH:6YS="P :60I.PT*(" ('T-" T*(" ("\O+R!#;W!Y M(&-O;G-T<G5C=&]R#0H (" 8F%S:6-?<F5S;W5R8V5?<W1R:6YG*&-O;G-T M(&)A<VEC7W)E<V]U<F-E7W-T<FEN9R F<FAS*0T*(" (" (" Z('!A<F5N M=%]C;&%S<U]T>7!E*')H<RD-"B ("![?0T*#0H (" +R\O($-O<'D 8V]N M<W1R=6-T;W(-"B ("!B87-I8U]R97-O=7)C95]S=')I;F<H8V]N<W0 <W1R M:6YG7W1Y<&4 )G)H<RD-"B (" (" .B!P87)E;G1?8VQA<W-?='EP92AR M:',I#0H (" >WT-" T*(" ("\O+R!#;W!Y(&%S<VEG;FUE;G0 ;W!E<F%T M;W(-"B ("!C;VYS="!B87-I8U]R97-O=7)C95]S=')I;F< )F]P97)A=&]R M(#TH8V]N<W0 8F%S:6-?<F5S;W5R8V5?<W1R:6YG("9R:',I#0H (" >PT* M(" (" ("!P87)E;G1?8VQA<W-?='EP93HZ;W!E<F%T;W( /2AR:',I.PT* M#0H (" (" (')E='5R;B J=&AI<SL-"B ("!]#0H (" +R\O($-O<'D M87-S:6=N;65N="!O<&5R871O< T*(" (&-O;G-T(&)A<VEC7W)E<V]U<F-E M7W-T<FEN9R F;W!E<F%T;W( /2AC;VYS="!S=')I;F=?='EP92 F<FAS*0T* M(" ('L-"B (" (" <&%R96YT7V-L87-S7W1Y<&4Z.F]P97)A=&]R(#TH M<FAS*3L-" T*(" (" ("!R971U<FX *G1H:7,[#0H (" ?0T*#0HO+R\ M0'T-" T*+R\ 26UP;&5M96YT871I;VX-"G!R:79A=&4Z#0H (" =W-?:6YT M7W0 3&]A9%-T<FEN9RA(24Y35$%.0T4 :&EN<W0L(&EN="!U240L('=S7V-H M87)?85]T("IB=69F97(L('=S7W-I>F5?="!C8VA"=69F97(I#0H (" >PT* M(" (" ("!R971U<FX .CI,;V%D4W1R:6YG02AH:6YS="P =4E$+"!B=69F M97(L(&-C:$)U9F9E<BD[#0H (" ?0T*(" ('=S7VEN=%]T($QO8613=')I M;F<H2$E.4U1!3D-%(&AI;G-T+"!I;G0 =4E$+"!W<U]C:&%R7W=?=" J8G5F M9F5R+"!W<U]S:7IE7W0 8V-H0G5F9F5R*0T*(" ('L-"B (" (" <F5T M=7)N(#HZ3&]A9%-T<FEN9U<H:&EN<W0L('5)1"P 8G5F9F5R+"!C8VA"=69F M97(I.PT*(" ('T-" T*(" ('9O:60 ;&]A9"A(24Y35$%.0T4 :&EN<W0L M('=S7VEN=%]T(&ED*2!T:')O=RAE>&-E<'1I;VY?='EP93HZ=&AR;W=N7W1Y M<&4I#0H (" >PT*(" (" (" O+R!43T1/.B!697)I9GD =&AA="!I="=S M(&YO="!P;W-S:6)L92!T;R!L;V%D('-T<FEN9R!R97-O=7)C97, ;V8 /C(U M-BX 268 =&AA="=S( T*(" (" (" O+R!W<F]N9RP =&AE;B!N965D('1O M(&9I>"!T:&ES('1O('5S92!A=71O7V)U9F9E< T*(" (" ("!V86QU95]T M>7!E("!S>ELQ,#(T73L-" T*(" (" ("!I9B P(#T]($QO8613=')I;F<H M:&EN<W0L(&ED+"!S>BP =VEN<W1L7VYU;5]E;&5M96YT<RAS>BDI*0T*(" M(" ("![#0H (" (" (" ("!E>&-E<'1I;VY?='EP92 I*&AI;G-T+"!I M9"D[#0H-"B-I9B P#0H (" (" (" ("!P87)E;G1?8VQA<W-?='EP93HZ M;W!E<F%T;W( /2AS=')I;F=?=')A:71S7W1Y<&4Z.F5M<'1Y7W-T<FEN9R I M*3L-"B-E;'-E#0H (" (" (" ("!P87)E;G1?8VQA<W-?='EP93HZ;W!E M<F%T;W( /2AS=')I;F=?='EP92 I*3L-"B-E;F1I9B O*B P("HO#0H (" M(" ('T-"B (" (" 96QS90T*(" (" ("![#0H (" (" (" ("!P M87)E;G1?8VQA<W-?='EP93HZ;W!E<F%T;W( /2AS>BD[#0H (" (" ('T- M"B ("!]#0I].PT*#0HO+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O#0HO+R!5;FET+71E<W1I;F<-" T*(VEF9&5F(%-43%-/1E1?54Y)5%1% M4U0-" T*;F%M97-P86-E('5N:71T97-T#0I[#0H (" ;F%M97-P86-E#0H M(" >PT*(" (" ("!S=')U8W0 =&AR;W=?97AC97!T:6]N#0H (" (" M('L-"B (" (" <'5B;&EC. T*(" (" (" (" +R\O(%1H92!E>&-E M<'1I;VX ='EP90T*(" (" (" (" ='EP961E9B!E>&-E<'1I;VX ("!T M:')O=VY?='EP93L-" T*(" (" ("!P=6)L:6,Z#0H (" (" (" ("!V M;VED(&]P97)A=&]R(" I*$A)3E-404Y#12!H:6YS="P :6YT(&ED*0T*(" M(" (" (" >PT*(" (" (" (" (" (&-H87( (" ;65S<V%G95LQ M,#%=.PT*#0H (" (" (" (" (" =W-P<FEN=&9!*&UE<W-A9V4L(")& M86EL960 =&\ ;&]A9"!R97-O=7)C92 E9"!F<F]M(&UO9'5L92 P>"4P.#0B M+"!I9"P :&EN<W0I.PT*#0H (" (" (" (" (" =&AR;W< <W1L<V]F M=%]N<U]Q=6%L7W-T9"AE>&-E<'1I;VXI*&UE<W-A9V4I.PT*(" (" (" M(" ?0T*(" (" ("!].PT*(" ('T-" T*#0H (" <W-?8F]O;%]T('1E M<W1?;69C<W1L7W)E<V]U<F-E7W-T<FEN9RAU;FET=&5S=%]R97!O<G1E<B J M<BD-"B ("![#0H (" (" ('5S:6YG('-T;'-O9G0Z.G5N:71T97-T.CIU M;FET=&5S=%]I;FET:6%L:7-E<CL-" T*(" (" ("!S<U]B;V]L7W0 (" M(" (" (" ("!B4W5C8V5S<R (" ](" =')U93L-" T*(" (" ("!U M;FET=&5S=%]I;FET:6%L:7-E<B ("!I;FET*'(L(")7:6Y35$PB+" B<F5S M;W5R8V5?<W1R:6YG(BP 7U]&24Q%7U\I.PT*#0H (" (" ('1Y<&5D968 M8F%S:6-?<F5S;W5R8V5?<W1R:6YG/'-T;'-O9G1?;G-?<75A;%]S=&0H<W1R M:6YG*3X (')S;E]A7W0[#0H (" (" ('1Y<&5D968 8F%S:6-?<F5S;W5R M8V5?<W1R:6YG/'-T;'-O9G1?;G-?<75A;%]S=&0H=W-T<FEN9RD^(')S;E]W M7W0[#0H-"B (" (" 2$E.4U1!3D-%(" :&EN<W0 (" ](" .CI,;V%D M3&EB<F%R>2 B55-%4C,R(BD[#0H (" (" (&EN=" (" (" (&E"860 M(" /2 ("TQ.PT*(" (" ("!I;G0 (" (" ("!I1V]O9" (#T (" M M,3L-" T*(" (" ("!F;W(H:6YT(&D /2 P.R!I(#P ,3 P,# [("LK:2D- M"B (" (" >PT*(" (" (" (" <G-N7V%?=" (" <G-N7V%?,BAH M:6YS="P :2D[#0H (" (" (" ("!R<VY?=U]T(" ("!R<VY?=U\R*&AI M;G-T+"!I*3L-" T*(" (" (" (" :68H," ]/2!R<VY?85\R+FQE;F=T M:" I*0T*(" (" (" (" >PT*(" (" (" (" (" (&EF*"TQ(#T] M(&E"860I#0H (" (" (" (" (" >PT*(" (" (" (" (" (" M("!I0F%D(#T :3L-"B (" (" (" (" ("!]#0H (" (" (" ("!] M#0H (" (" (" ("!E;'-E#0H (" (" (" ("![#0H (" (" (" M(" (" :68H+3$ /3T :4=O;V0I#0H (" (" (" (" (" >PT*(" M(" (" (" (" (" ("!I1V]O9" ](&D[#0H (" (" (" (" (" M?0T*(" (" (" (" ?0T*#0H (" (" (" ("!I9BAR<VY?85\R+FQE M;F=T:" I("$](')S;E]W7S(N;&5N9W1H*"DI#0H (" (" (" ("![#0H M(" (" (" (" (" <BT^<F5P;W)T*")R97-O=7)C92!S=')I;F< *&YU M;&P 97AC97!T:6]N*2!L96YG=& ;6ES;6%T8V 8F5T=V5E;B!!3E-)(&%N M9"!5;FEC;V1E(&EN<W1A;G1I871I;VYS(BP 7U],24Y%7U\I.PT*(" (" M(" (" (" (&)3=6-C97-S(#T 9F%L<V4[#0H (" (" (" ("!]#0H M(" (" ('T-" T*(" (" ("!I9BAB4W5C8V5S<RD-"B (" (" >PT* M(" (" (" (" ='EP961E9B!B87-I8U]R97-O=7)C95]S=')I;F<\<W1L M<V]F=%]N<U]Q=6%L7W-T9"AS=')I;F<I+"!T:')O=U]E>&-E<'1I;VX^(" M("!R<WA?85]T.PT*(" (" (" (" ='EP961E9B!B87-I8U]R97-O=7)C M95]S=')I;F<\<W1L<V]F=%]N<U]Q=6%L7W-T9"AW<W1R:6YG*2P =&AR;W=? M97AC97!T:6]N/B ("!R<WA?=U]T.PT*#0H (" (" (" ("!I9B M,2 A M/2!I1V]O9"D-"B (" (" (" ('L-"B (" (" (" (" ("!T<GD- M"B (" (" (" (" ("![#0H (" (" (" (" (" (" (')S>%]A M7W0 (" (')S;E]A7S(H:&EN<W0L(&E';V]D*3L-"B (" (" (" (" M(" (" <G-X7W=?=" (" <G-N7W=?,BAH:6YS="P :4=O;V0I.PT*(" M(" (" (" (" ('T-"B (" (" (" (" ("!C871C:"AS=&0Z.F5X M8V5P=&EO;B F+RH >" J+RD-"B (" (" (" (" ("![#0H (" (" M(" (" (" (" ('(M/G)E<&]R=" B<F5S;W5R8V4 <W1R:6YG("AS=&0Z M.F5X8V5P=&EO;BD 9F%I;&5D('1O(&QO860 :VYO=VX <F5S;W5R8V4 9G)O M;2!54T52,S(B+"!?7TQ)3D5?7RD[#0H (" (" (" (" (" (" (&)3 M=6-C97-S(#T 9F%L<V4[#0H (" (" (" (" (" ?0T*(" (" (" M(" ?0T*#0H (" (" (" ("!I9B M,2 A/2!I0F%D*0T*(" (" (" M(" >PT*(" (" (" (" (" ('1R>0T*(" (" (" (" (" ('L- M"B (" (" (" (" (" (" <G-X7V%?=" (" <G-N7V%?,BAH:6YS M="P :4)A9"D[#0H-"B (" (" (" (" (" (" <BT^<F5P;W)T*")R M97-O=7)C92!S=')I;F< *'-T9#HZ97AC97!T:6]N*2!L;V%D960 :VYO=VX M:6YV86QI9"!R97-O=7)C92!F<F]M(%5315(S,B(L(%]?3$E.15]?*3L-"B M(" (" (" (" (" (" 8E-U8V-E<W, /2!F86QS93L-"B (" (" M(" (" ("!]#0H (" (" (" (" (" 8V%T8V H<W1D.CIE>&-E<'1I M;VX )B\J(' *B\I#0H (" (" (" (" (" >WT-" T*(" (" (" M(" (" ('1R>0T*(" (" (" (" (" ('L-"B (" (" (" (" M(" (" <G-X7W=?=" (" <G-N7W=?,BAH:6YS="P :4)A9"D[#0H-"B M(" (" (" (" (" (" <BT^<F5P;W)T*")R97-O=7)C92!S=')I;F< M*'-T9#HZ97AC97!T:6]N*2!L;V%D960 :VYO=VX :6YV86QI9"!R97-O=7)C M92!F<F]M(%5315(S,B(L(%]?3$E.15]?*3L-"B (" (" (" (" (" M(" 8E-U8V-E<W, /2!F86QS93L-"B (" (" (" (" ("!]#0H (" M(" (" (" (" 8V%T8V H<W1D.CIE>&-E<'1I;VX )B\J(' *B\I#0H M(" (" (" (" (" >WT-"B (" (" (" ('T-"B (" (" ?0T* M#0H (" (" (')E='5R;B!B4W5C8V5S<SL-"B ("!]#0H-"B ("!U;FET M=&5S=%]R96=I<W1R87( (" =6YI='1E<W1?;69C<W1L7W)E<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\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O+R\O+R\O+R\O("HO#0H-"B-I9FYD968 7U=)3E-43%].3U].04U%4U!! M0T4-"B, :69D968 7U-43%-/1E1?3D]?3D%-15-004-%#0I]("\O(&YA;65S M<&%C92!W:6YS=&P-"B, 96QS90T*?2 O+R!N86UE<W!A8V4 =VEN<W1L7W!R M;VIE8W0-"GT +R\ ;F%M97-P86-E('-T;'-O9G0-"B, 96YD:68 +RH 7U-4 M3%-/1E1?3D]?3D%-15-004-%("HO#0HC96YD:68 +RH (5]724Y35$Q?3D]? M3D%-15-004-%("HO#0H-"B\J("\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O("HO#0H-"B-E;F1I9B O*B A7U=)3E-43%])3D-,7TA?5TE.4U1,7U)% M4T]54D-%7U-44DE.1R J+PT*#0HO*B O+R\O+R\O+R\O+R\O+R\O+R\O+R\O M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O ,+R\O+R\O+R J+PT* ` end
May 21 2004
parent reply "Pablo Aguilar" <paguilarg hotmail.com> writes:
Thanks!

I've just recently decided not to hard code strings anymore, and this is
coming in real handy...

 I've done it, and added in unit testing (and tested it!). Here's a sneak
preview.
 Note: It does work with UNICODE. I was blowing hot air. ;)
May 21 2004
parent reply "Matthew" <matthew.hat stlsoft.dot.org> writes:
Pleasure. :)

"Pablo Aguilar" <paguilarg hotmail.com> wrote in message
news:c8ludf$1ar7$1 digitaldaemon.com...
 Thanks!

 I've just recently decided not to hard code strings anymore, and this is
 coming in real handy...

 I've done it, and added in unit testing (and tested it!). Here's a sneak
preview.
 Note: It does work with UNICODE. I was blowing hot air. ;)
May 21 2004
parent reply "Ryan Ginstrom" <ryan ginstrom.com> writes:
I have just starting using stlsoft, and I like it a lot.

A note about basic_resource_string, though.

The Unicode version uses LoadStringW, but that function does not work on
Win9x.

Below my sig is a method I use to ensure that retrieving resource strings as
Unicode works on Win9x platforms, adapted from an MSDN example.

-- 
Regards,
Ryan Ginstrom
ryang gol.com

// Function name : resource2wstring
// Description     : LoadStringW returns NULL on Win9x, so we need this
workaround
inline wstring resource2wstring( const UINT uid, const HINSTANCE instance )
{
 UINT block = (uid >> 4) + 1;   // Compute block number.
 UINT num = uid & 0xf;      // Compute offset into block.

 HRSRC hRC = FindResourceEx( instance,
  RT_STRING,
  MAKEINTRESOURCE(block),
  MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));

 if ( hRC == NULL )
  return wstring() ;

 HGLOBAL hgl = LoadResource(instance, hRC);

 if ( hgl == NULL )
  return wstring() ;

 LPWSTR res_str = (LPWSTR)LockResource(hgl);

 if ( res_str == NULL )
  return wstring() ;

 for ( UINT i = 0; i < num; i++)
 {
  res_str += *res_str + 1;
 }

 return wstring( res_str + 1,  *res_str );
}
Dec 11 2004
next sibling parent reply "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
"Ryan Ginstrom" <ryan ginstrom.com> wrote in message
news:cpgjpd$11ps$1 digitaldaemon.com...
 I have just starting using stlsoft, and I like it a lot.
Great! May I ask how/from whom you heard about it?
 A note about basic_resource_string, though.

 The Unicode version uses LoadStringW, but that function does not work
on
 Win9x.

 Below my sig is a method I use to ensure that retrieving resource
strings as
 Unicode works on Win9x platforms, adapted from an MSDN example.
Ok. I'll check it out, and have a think about it. Assuming it's the go, how would you feel about my incorporating this into a future release? Naturally your input would be suitably credited. Cheers Matthew
 Regards,
 Ryan Ginstrom
 ryang gol.com

 // Function name : resource2wstring
 // Description     : LoadStringW returns NULL on Win9x, so we need
this
 workaround
 inline wstring resource2wstring( const UINT uid, const HINSTANCE
instance )
 {
  UINT block = (uid >> 4) + 1;   // Compute block number.
  UINT num = uid & 0xf;      // Compute offset into block.

  HRSRC hRC = FindResourceEx( instance,
   RT_STRING,
   MAKEINTRESOURCE(block),
   MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));

  if ( hRC == NULL )
   return wstring() ;

  HGLOBAL hgl = LoadResource(instance, hRC);

  if ( hgl == NULL )
   return wstring() ;

  LPWSTR res_str = (LPWSTR)LockResource(hgl);

  if ( res_str == NULL )
   return wstring() ;

  for ( UINT i = 0; i < num; i++)
  {
   res_str += *res_str + 1;
  }

  return wstring( res_str + 1,  *res_str );
 }
Dec 12 2004
parent reply "Ryan Ginstrom" <ryan ginstrom.com> writes:
"Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message
news:cpidmd$2sut$1 digitaldaemon.com...
 "Ryan Ginstrom" <ryan ginstrom.com> wrote in message
 I have just starting using stlsoft, and I like it a lot.
May I ask how/from whom you heard about it?
I actually heard about stlsoft a while ago (I have version 1.6.5 sitting on my hard disk), but just recently started using it after reading your description of it in your article on C# performance. That article spurred me to take a closer look at the library, and I'm very glad I did. There is lots of great stuff in there, and it actually works! <g>
 Below my sig is a method I use to ensure that retrieving resource
strings as
 Unicode works on Win9x platforms, adapted from an MSDN example.
Ok. I'll check it out, and have a think about it. Assuming it's the go, how would you feel about my incorporating this into a future release? Naturally your input would be suitably credited.
I don't mind all, but as I mentioned it is adapted from an MSDN example, not original. -- Regards, Ryan Ginstrom ryang gol.com
Dec 12 2004
parent reply "Matthew" <admin.hat stlsoft.dot.org> writes:
"Ryan Ginstrom" <ryan ginstrom.com> wrote in message
news:cpii35$30mp$1 digitaldaemon.com...
 "Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message
 news:cpidmd$2sut$1 digitaldaemon.com...
 "Ryan Ginstrom" <ryan ginstrom.com> wrote in message
 I have just starting using stlsoft, and I like it a lot.
May I ask how/from whom you heard about it?
I actually heard about stlsoft a while ago (I have version 1.6.5 sitting on my hard disk), but just recently started using it after reading your description of it in your article on C# performance. That article spurred me to take a closer look at the library, and I'm very glad I did. There is lots of great stuff in there, and it actually works! <g>
Well, that's because I use it a lot, I guess. It's a much easier task to create a library that works when its author uses it. ;-) The one Achilles heal for STLSoft is the lamentable documentation. I am hoping to get time to address that soon, but it's always dragging behind new components, and new sub-projects (of which I have three planned for release soon: ACESTL, DbSTL, XMLSTL)
 Below my sig is a method I use to ensure that retrieving resource
strings as
 Unicode works on Win9x platforms, adapted from an MSDN example.
Ok. I'll check it out, and have a think about it. Assuming it's the go, how would you feel about my incorporating this into a future release? Naturally your input would be suitably credited.
I don't mind all, but as I mentioned it is adapted from an MSDN example, not original.
Understood. Thanks again. Feel free to post requests/bugs/criticisms here, or email them to me directly. Cheers Matthew
Dec 12 2004
parent "Ryan Ginstrom" <ryan ginstrom.com> writes:
"Matthew" <admin.hat stlsoft.dot.org> wrote in message
news:cpin60$4mg$1 digitaldaemon.com...
 The one Achilles heal for STLSoft is the lamentable documentation. I am
hoping to get time to address that soon, but
 it's always dragging behind new components, and new sub-projects (of which
I have three planned for release soon:
 ACESTL, DbSTL, XMLSTL)
Documentation would be nice (as would a good XML parser/writer). I am no one to talk though, being rather poor at writing documentation myself. Luckily though, the various classes can generally just be dropped in and used without too much fuss. I just checked out the resource_string implementation because I have been bitten by this problem before. -- Regards, Ryan Ginstrom ryang gol.com
Dec 12 2004
prev sibling parent "Matthew" <admin.hat stlsoft.dot.org> writes:
Ryan

I've finally incorporated this. Sorry for the delay.

It'll be in 1.8.3 beta5, which will probably be sometime this week or next.
When you get a chance, it'd be great if you 
can check it out on 9x. I've tested it by 'pretenting' to be 9x on XP, but some
finite doubt remains until it's tested 
on a real 9x system.

Thanks again for the insight. I've mentioned you in the
(winstl_resource_string.h) file header, and also in the Doxygen 
stuff. I've amended the copyright to now say:

 * Home:        http://stlsoft.org/
 *
 * Copyright 1994-2005, Matthew Wilson and Synesis Software
 * Copyright 2004-2005, Ryan Ginstrom


Cheers, and thanks again

Matthew


"Ryan Ginstrom" <ryan ginstrom.com> wrote in message
news:cpgjpd$11ps$1 digitaldaemon.com...
I have just starting using stlsoft, and I like it a lot.

 A note about basic_resource_string, though.

 The Unicode version uses LoadStringW, but that function does not work on
 Win9x.

 Below my sig is a method I use to ensure that retrieving resource strings as
 Unicode works on Win9x platforms, adapted from an MSDN example.

 -- 
 Regards,
 Ryan Ginstrom
 ryang gol.com

 // Function name : resource2wstring
 // Description     : LoadStringW returns NULL on Win9x, so we need this
 workaround
 inline wstring resource2wstring( const UINT uid, const HINSTANCE instance )
 {
 UINT block = (uid >> 4) + 1;   // Compute block number.
 UINT num = uid & 0xf;      // Compute offset into block.

 HRSRC hRC = FindResourceEx( instance,
  RT_STRING,
  MAKEINTRESOURCE(block),
  MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));

 if ( hRC == NULL )
  return wstring() ;

 HGLOBAL hgl = LoadResource(instance, hRC);

 if ( hgl == NULL )
  return wstring() ;

 LPWSTR res_str = (LPWSTR)LockResource(hgl);

 if ( res_str == NULL )
  return wstring() ;

 for ( UINT i = 0; i < num; i++)
 {
  res_str += *res_str + 1;
 }

 return wstring( res_str + 1,  *res_str );
 }
 
Mar 21 2005