|
I can't speak Chinese, ony Polish! Using a resource only DLL means you have to define the menus, dialogs etc. in each language for each resource only DLL. Then when a new resource only DLL is loaded, the Menus Dialogs etc. from the new DLL will be used, rather that the default resources.
But if you just want to use a French text string on and English Dialog box you could do:-
hInstFrench = LoadLibrary(_T("LangFRA.dll"));<br />
LoadString(hInstFrench, ID_TEXT, lpBuffer, nBuffSize);<br />
SetWindowText(hWnd, lpBuffer);
I hope this helps. This is one solution there are many others.
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
thanks Ted... let me try your method first! ah! one more question, does it work on win98? or, a win2k without select French, German in regional setting?
thanks,
jim
|
|
|
|
|
Yes it should do work on 98/win2k, you would need to check on the regional setting of the PC and select the language DLL to use if you want to select a language automatically, my demo prog will show you what I mean.
e.g. if your default language is English a user in France, on the German border, would automatically get French, assuming a French resource DLL exists! if the PC was French, but if the user was German, they may prefer to work in their own language, so they would have to select the language to be German via the menu.
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
i found strange problem actually i occurred b4.
the problem is, in win2k, i selected several regional fonts and set one as the default. for example, i set english as default and selected french in regional settings as well. then, in your application, i switch to french. the text in menu can be displayed properly but not the text in dialog box and background view.
this problem also occurred in my application which have single language. foe example, my app. is in traditional chinese. when i switch to simplified chinese as default and selected simplified chinese in regional settings. the trad. chinese menu can display correctly... but, dialog failed!
do u know the reason?
thanks,
jim
|
|
|
|
|
The dialog box should not be a problem, IF it is defined in relevant language DLL.
Some elements, you will need to update manually, such as the status text in the staus bar, i.e. change "Ready" to "Gotowy" in Polish.
These will normally update once Windows has forced a repaint or the text changes.
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
Ted, i think you don't understand my question...
i have captured several screenshoot in the below link...
you may get it after read them.
http://ux.aiib.net/~chaze/sctc.html
pls give me some idea!
thanks,
jim
|
|
|
|
|
there are lots of issues here like mbcs vs unicode either ucs16 or rtf8.
as long as you are sticking with nt / w2k / xp use unicode
win95 / win98 will be painful.
The font selected for the dialog / controls needs to actually have gylphs for the unicode characters you are trying to display in the language you are trying to display them in. its not enough to simply use the correct unicode chinese character you also need to have selected an appropriate font.
note most 'foreign' fonts will have at least the first 128 / 256 ascii / ansi gylphs in them as well for english.
|
|
|
|
|
My printf statement isn't giving me the expected results. Can anyone see where I am going wrong here? Thanks, Joanne
void LogFormattedMessage(char * sMessage, ...)<br />
{<br />
va_list ap;<br />
va_start(ap, sMessage); <br />
<br />
<br />
TCHAR sFormattedMessage[500];<br />
_stprintf(sFormattedMessage, sMessage, ap);<br />
va_end(ap); <br />
<br />
...<br />
}
|
|
|
|
|
I'm not sure exactly what stprintf does, but it appears to be a variant of sprintf for TCHAR's. To use var args you need one that takes a va_list - have a look at vsnprintf
|
|
|
|
|
Thanks, that function works properly.
(stprintf is just the tchar routine for sprintf)
Cheers, Joanne 
|
|
|
|
|
I need some programming advice to a specific problem I am having in my app. I have a bunch of owner-drawn buttons on the main window, all of which work with a tooltip through a hook. I have subclassed the windows to receive the WM_LBUTTONDOWN and WM_LBUTTONUP messages. When the user clicks on the button a "push" is simulated through InvalidateRect and through BitBlt in WM_DRAWITEM a new bitmap is painted when the mouse button is pressed down and then the button is repainted upon WM_LBUTTONUP. All this works fine expect when the tooltip is showing. I am thinking it has something to do with the hook. Does someone have a workaround for this. Here is the code to the hook procedure:
<br />
LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam)<br />
{ <br />
if (nCode < 0) <br />
return CallNextHookEx(cSkinObject.hMsgHook, nCode, wParam, lParam); <br />
<br />
switch ( ((MSG*)lParam)->message ) <br />
{ <br />
case WM_MOUSEMOVE:<br />
case WM_LBUTTONDOWN:<br />
SendMessage(hwndTool, TTM_RELAYEVENT, 0, lParam);<br />
<br />
break;<br />
<br />
default: <br />
<br />
break; <br />
} <br />
return CallNextHookEx(cSkinObject.hMsgHook, nCode, wParam, lParam); <br />
}<br />
<br />
Thanks in advance.<br />
|
|
|
|
|
SendMessage?
Try to use Postmessage.
The problem might be, that SendMessage does not return, until the message is processed.
G. Steudtel
|
|
|
|
|
Hello Im very new to windows proramming. I have a very basic question and thank you in advance for spending time to answer it.
I created a standard Dialog Box thru Appwizard (VC++ 6.0).
I need to use a function that needs the boxs' handle as the first parameter
where can I find this? I look on InitInstance and the construcor but I cant seem to find where the member variable is.
please help.
Thank you again 
|
|
|
|
|
|
|
I've been looking at the documentation of GetSafeHwnd()
it was attached to a member variable of a window.
ex. m_csEdit.GetSafeHwnd(param1,param2) ;
It can make it work for controls within my Dialog box but
not with a Dialog box itself.
Would someone be able to show me a skeleton code?
I need to get a handle of the only Dialog box I have
created by Appwizard(my program is Dialog Based).
Thanks everyone
|
|
|
|
|
Hiya I have a string in a file e.g
char buffer[] = "mike,jones,28,accountant";
and 4 variables: char FirstName[30],Surname[30],Age[30],Occupation[30];
What I am trying to do is split up the string and store each field in its relevant variable i.e store mike into FirstName and so on.
I have actually done this and it works fine but it is a very long winded approch. e.g
pDest = strchr( buffer,ch );
position = (int)( pDest - buffer );
for( i=0;i
|
|
|
|
|
If you use MFC, you may try AfxExtractSubString (the undocumented function declared in afxwin.h ).
If you don't, it would be wise to write a parser class instead of putting clumsy inline code into your application itself.
Regards,
BB
|
|
|
|
|
|
hello
i creat a vector in class named foufou vector< foufou * > fou_caracter; and in an other class i store in the vector a random position that i generat
by rand
void creatfoufou::creatfou(int amount)<br />
{<br />
foufou *newfoufouPtr;<br />
<br />
int speed,steer;<br />
<br />
for(int index=0;index<amount;index++)<br />
{<br />
<br />
<br />
ptrfoufou->initPosX =( ( 1 + rand( ) % 100 ) - 50 );<br />
ptrfoufou->initPosY =( ( 1 + rand( ) % 100 ) - 50 );<br />
ptrfoufou->initPosZ =( ( 1 + rand( ) % 100) - 50);<br />
<br />
newfoufouPtr = new foufou();<br />
fou_caracter.push_back( newfoufouPtr );<br />
<br />
<br />
<br />
<br />
}<br />
}<br />
<br />
and in an other function i want read the vector but i don't can
void creatfoufou::iteratorVector()<br />
{<br />
<br />
creatfou(5);<br />
int vectorIndex;<br />
vectorIndex = fou_caracter.size();<br />
<br />
for (int i=0;i<vectorIndex ;i++)<br />
{<br />
<br />
ptrfoufou->RePaint(<br />
fou_caracter[i]->initPosX,<br />
fou_caracter[i]->initPosY,<br />
fou_caracter[i]->initPosZ);<br />
}<br />
<br />
<br />
}
what is the error with this???
|
|
|
|
|
Your loop is not correct!
for( int i=0; i < vectorIndex; i++ ) and do not use (->) to access fou_caracter!
|
|
|
|
|
sorry
can you precise i don't understand very well what i must use to access to fou_caracter,because it my first time to use the vector
|
|
|
|
|
Hi,
I use the msdn code for getting multiple lines in a CEdit to a CString and it works great. But my problem is when a line have only 1 character the CString value return by the code below do not have the corresponding character but a \0 (i think, well it's like a \t or \r or \n in the debug, it's a square)
This is the code I use (line is return in strText)
int n = TempEditM->GetLineCount(); // Récupère le nombre de lignes
for (int i=0;i<n;i++)
{
int="" len="TempEditM-">LineLength(TempEditM->LineIndex(i));
TempEditM->GetLine(i, strText.GetBuffer(len), len);
strText.ReleaseBuffer(len);
}
Can you help me please ?? Thanks you very much
|
|
|
|
|
I think what you are seeing is the 'soft line-break' character but I could be wrong.
You can view the memory:
LPTSTR szBuffer = strText.GetBuffer(len);
TempEditM->GetLine(i, szBuffer, len);
strText.ReleaseBuffer();
ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33
|
|
|
|
|
hi,
The value of the character is 0x01... But i'd like to have the right character. For exemple, if my edit box ahve the lines :
abcdefghijklmnop
q
The first return is strText is : "abcdefghijklmnop"
and the second is : char(0x01) but not "q"
Do you know why i get this 0x01 instead of the "q" ??
Thank you .
|
|
|
|