|
I18n is not a big package. It is a standard to retrieve language dependent resources. It works always the same way to retrieve e.g. a string resource from your program. If You have set a language on program startup the corresponding resource dll which the translated resources is loaded. The dlls are located according to I18n in the en,de,us,... directories below your .dll,.exe which is translated. I18n only helps You to find the proper dll for the currently selected language. Normally there is a global resource handle defined e.g.
HANDLE g_inst = 0;
If your application now does sth like CString str; str.LoadString(IDS_NAME);
Your LoadString implementation has to use the g_inst handle and all is fine.
If no translated resource exists you always have the fallback of your internal resources which you did include in the dll,.exe at compile time. You only have to use the current module handle thats all I think.
|
|
|
|
|
Sorry, perhaps my issues weren't made clear.
I am looking to implement i18n and l10n in a cross platform C++ framework. Not MFC and not just for windows (if that were the case it would be a non-issue).
My questions are more along the lines of what do I need specifiy in terms of an interface (or interfaces) to provide this kind of support
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
i want to know how many bytes have been sent while i'm send something,so that i can control a progressbar to show the progress.how can i do it?(i'm using SDK)
modified 1-May-21 21:01pm.
|
|
|
|
|
WSASend() and send() winsock API returns the actual number of bytes sent.
Kuphryn
|
|
|
|
|
Hi.......I want to save desktop's image in 256 colour settings programatically. Actually I have done it but some colour loss is there. So please let me know some idea or some piece of code through which I can save image as it actual looks like.
Thanks a lot.
C.R.Naik
|
|
|
|
|
Does this article help any?
http://flounder.com/screencapture.htm
|
|
|
|
|
Thanks for you support.....
This is not a perfect solution for me because I want to save image as bitmap file and particularly for 256 colour image. Currently I can do it but some colour loss is there.
Thanks again
C.R.Naik
|
|
|
|
|
Please help!! When I stop my application (appl1.exe), the process appl1.exe is not killed. Bellow is the loop that causes this problem.
for(;;){
Sleep(100);//pour alléger le CPU
DoEvents();
if (Playing==FALSE)
{
Playing=TRUE;
break;
} //end if
}// end for
where:
void DoEvents(void)
{
MSG msg;
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Thank you very much in advance.
Zakaria
azakaria_2000@voila.fr
|
|
|
|
|
Have you initialised and set Playing correctly? If it isn't set to FALSE, then the for loop will never break.
|
|
|
|
|
Thanks a lot!! You are right!!
|
|
|
|
|
hi
i'm creating a new dialog box when a user clicks a button om my existing dialog, using code:
CDialog *cd = new CDialog(IDD_SHOW);
cd->DoModal(); //displayed modally
delete cd;
how do i set text in an edit box in the dialog box IDD_SHOW
(the id of editbox id IDC_E_DATA.)
|
|
|
|
|
GetDlgItem( IDC_E_DATA)->SetWindowText("text");
NHM
|
|
|
|
|
You have to make your own class derived from CDialog: when you have your resource editor open, open classWizzard and it will says that IDD_SHOW is a new resource and if you want to create a new class for it. Say yes and specify your class name (CMyDialog for example).
Click on the member variable tab and add a member variable for your edit box (IDC_E_DATA) of type CString (says m_MyString).
Then you have to add a public member function within your class to set the string:
CMyDialog::SetStringData(CString NewString)
{
m_MyString = NewString;
}
Then, in your OnInitDialog function, call UpdateData(FALSE);
Thats it, hope this helps
Cédric Moonen
|
|
|
|
|
You could try to get a pointer to the edit ctrl or even make a public var that hosts the edit ctrl. But the best method (afaik) would be to create a public function inside the newly created dialog that receive a CString as a parameter.
Then from your code you should have to call that function and that would be done.
-----------------------------------------------------------------------------
Ways for setting the text (inside the function and in the implementation file of your dialog class):
1. you should create a CString var. related to the edit control using the class wizard, once that is done you can modify it's value in that previously named public function by setting the value and UpdateData(FALSE); call.
2. you could create a CEdit var. related to the edit control using the class wizard, once that is done you can modify it's value by using SetWindowText(); .
3. you could try to search for your control inside the dialog and then set the text directly via SetWindowText();
hope this helps...
|
|
|
|
|
btw, if you create a modal dialog, you need not create the variable on the heap. Just do
CDialog cd;
cd.DoModal();
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Use SetDlgItemText(...) function in the OnInitDialog()
handler of the dialog box.
eg
SetDlgItemText(IDC_E_DATA,string_data);
R.Balachandran
|
|
|
|
|
I need to develop a VC 6.0 dll routine to be called be VB.
The VB program has a hierarchy of form calling sequence.
MainForm -> FormP -> FormQ or
MainForm -> FormX -> FormY
My VC routine in dll will be called in ANY of these five forms. Is there any way for the VC routine dynamically obtain the handle of the MainForm no matter from which form it is called.
Thank you.
|
|
|
|
|
wavewave wrote:
Is there any way for the VC routine dynamically obtain the handle of the MainForm no matter from which form it is called.
In short, no. What you'll need to do is pass it as a parameter.
In your VC routine, try this...
void MyFunc (HWND hWnd, ...);
And call it from a form in VB like this...
MyFunc Me.hWnd, ...
Jeremy Falcon
|
|
|
|
|
Thanks for your information. As there are nested call in forms, I wish to avoid handle passing and wonder if GetWindow command can accomplish my requirement.
|
|
|
|
|
The best (and most reliable) way is to pass its handle. I mean you can say frmWhatever.hWnd throughout the entire VB project because forms have global scope.
In the VC++ DLL using the GetWindow() method will not return the handle for the VB form. You can try using something like FindWindow(), but there's no guarantee you'll get the exact handle you want.
Jeremy Falcon
|
|
|
|
|
How can I change the color of text and background within a SINGLE panel of the Status Bar?
I have use SB_SETBKCOLOR message but it changes the background color of ALL panels of the Status Bar and I cannot change the color of the text.
Thank you.
|
|
|
|
|
The panes are not separate windows. Therefore they cannot be operated on individually, at least not that I know of.
|
|
|
|
|
However some applications such as MS Visual C development can create this effect.
For MS Visual C, when I search a text pattern in the program source and it can found no more, a message with different background and text color is shown in left panel of status bar with the remaining status bar unchanged.
Please advise
|
|
|
|
|
DavidCrow is right. At the heart of it all, it is one window. To achieve this effect it'll have to be owner drawn, and you control all of the painting yourself.
Jeremy Falcon
|
|
|
|
|
This is probubly a bad idea but it does work.
void CTestStatusBar::OnPaint()
{
CStatusBar::OnPaint();
CRect rc;
GetItemRect(2,&rc);
rc.DeflateRect(2,2);
CClientDC CliDC(this);
CBrush brush(RGB(255,0,0));
CBrush* pOldBrush = CliDC.SelectObject(&brush);
COLORREF clr = CliDC.GetPixel(rc.left,rc.top);
CliDC.ExtFloodFill(rc.left,rc.top,clr,FLOODFILLSURFACE);
CliDC.SelectObject(pOldBrush);
}
Trust in the code Luke. Yea right!
|
|
|
|