|
It will be slower, but we are talking about UI strings here. Most UI elements have very few strings so the impact will be the UI loading a few milliseconds slower. I doubt a user would ever notice the difference.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I've just gone through the same problem in a large application. We've had some problems with the strings that have had to be located in the database, namely maintenance issues (it can be a bit of a pain to add new or change existing strings). For a good 90% of the strings, we put them in XML files that are loading into hash tables at run time. I prefer this approach, but either/or are a *lot* easier than resources! Just one more piece of advise, make sure however you put the strings together that you can change the order of the parameters in the string itself. We had some developers putting in printf-style formatting, and that was a nightmare for the translators.
|
|
|
|
|
Hi,
I am programming a custom error dialog box with two three CStatic Controls.
The first is a title, the second is a message and the third is a picture box set to be a icon.
The first two are okay. The third is really bugging me!
I've created a variable for the CStatic from the Variable Wizard called m_Icon and then in Init_Dialg I set it to a standard Icon using this:
<br />
m_Icon.SetIcon(AfxGetApp()->LoadStandardIcon(IDI_EXCLAMATION)); <br />
I have also tried creating an Icon using HICON and setting the control to the HICON and using the method m_Icon.SetIcon(::LoadIcon(IDI_EXCLAMATION));
They all compile fine.
But when i the app runs, i dont see the Icon. The Controls Visability is set to TRUE.
Where have I gone wrong and how can I correct this?
Many Thanks
Tom.
P.S Personally creating Custom Error Dialogs is a pain, and I am looking forward to seeing the Windows Vista TaskDialog!!
-- modified at 16:09 Sunday 22nd January, 2006
|
|
|
|
|
LoadStandardIcon() takes a LPCTSTR , not an UINT . Use the MAKEINTRESOURCE macro to convert IDI_EXCLAMATION to an LPCTSTR .
m_Icon.SetIcon(AfxGetApp()->LoadStandardIcon(MAKEINTRESOURCE(IDI_EXCLAMATION)); ::LoadIcon takes two parameters, the first of which is the handle to the applications's instance, or NULL if loading standard icons. I am surprised the code even compiled.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Actually, IDI_EXCLAMATION is defined in winuser.h using MAKEINTRESOURCE() , so it's not needed here.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Does your static control have the SS_ICON style set?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
MSG msg; <br />
<br />
while( TRUE )<br />
<br />
{ <br />
<br />
if ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )<br />
<br />
{ <br />
<br />
if ( msg.message == WM_QUIT )<br />
<br />
{<br />
<br />
break;<br />
<br />
}<br />
<br />
TranslateMessage( &msg );<br />
<br />
DispatchMessage( &msg );<br />
<br />
}<br />
<br />
}
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Yes, it's a message loop and ...??? What is EXACTLY the question ?
|
|
|
|
|
do you think this would be substantially enough for a DX game?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Because you're using PeekMessage rather then GetMessage your loop spins in the outer while loop even when there is no message to process. Unless you have an else not show in the code above in the if ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) statement this code is needlessly inefficient. I would suggest you replace it with a GetMessage and watch the CPU usage go down.
Steve
|
|
|
|
|
thank you for the comment, and yes I do have an else statement in the block but forgot to write it in. so you think it will still be good if it has an else block or should i stick with getmessage?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Normally you'd use PeekMessage and perform some idle time processing in the else part. I'm not sure what's going on in the else bit but it looks ok to me. I find myself a little concerned that you may be busy waiting but I'd have to see the else bit to be sure.
Steve
|
|
|
|
|
Does anyone know of a good C++ lib that is free and can replace ATL functionality, specifically implementing enough for the Web Browser component?
[edited:]
This is specifically to implement the set of COM interfaces needed to host the IWebBrowser control. I'd prefer not to have to write all this nonsense from scratch, hence the interest in a library other than ATL to do so for me. MFC won't work, it needs to be freely redistributable in source form (and no GPL crap licensing either).
[/edited]
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
-- modified at 13:37 Sunday 22nd January, 2006
|
|
|
|
|
MFC although wouldn't recommend it... WTL which is on sourceforge... found here http://sourceforge.net/projects/wtl[^]
ALSO TRY USING .NET WHICH IS LIKE MFC ON ULTRA STERIODS.
I personally think that .NET will eventually replace windows programming, not including game programming.
IM PROUD TO BE A GMAIL;
-- modified at 11:01 Sunday 22nd January, 2006
|
|
|
|
|
ATL is a library to write COM code, right? How does it relate to MFC, which is primary targeted for GUI development?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
He didn't say it had to support COM code, right? and also, I said that I wouldn't recommend it (MFC);)... also I said WTL which is actually based off of ATL. Any more questions about what I said?
Doesn't MFC support Web Browser functionality?
IM PROUD TO BE A GMAIL;
-- modified at 11:41 Sunday 22nd January, 2006
|
|
|
|
|
tom_dx wrote: I personally think that .NET will eventually replace windows programming,
|
|
|
|
|
I suggested that he use .net instead of atl for gui programming.
IM PROUD TO BE A GMAIL;
|
|
|
|
|
|
|
Because I need to add WebBrowser support in the VCF. Currently I'm using ATL to do so, but I have been told that it's not usable on compilers like MINGW, because the ATL headers/libs are not re-distributable. So I need something else.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
|
Yeah I found that too. It looks like good wrapper for the basic COM stuff, but sadly they don't implement any of the OLE container junk you need to host activeX controls like IWebBrowser.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Hi!
I need to write code, which convert series of images to animated gif.
Is some opensource solution for this problem?
Thanks.
|
|
|
|
|
finally, after 3 weeks and more than 2000 pages c & c++ books I write my project.
I should thanks for anybody who help me during this time and specially codeproject.
now I have two complete program:
1-ARRAY ADT
2-TEXT MANIPULATION
who want these project or for any sharing and testing;
vatanpoor@gmail.com
vatanpour@msn.com
Best Regards,
Pouya
|
|
|
|