|
when the task ends, just send a WM_CLOSE to the window displaying the "please wait..."
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
In VC++ 6, there's an add-in to insert a progress dialog box. (not sure about vc++7) Once inserted, you could strip out the progress controls/code, and use the default static control for your "Please wait..." message.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Hi
You can use CStatic Class to show "please wait..." message.
if u wanted to know when task ended u can use Threads API functions or MFC threads functions as AfxBeginThread(threadfun,hwnd,threadpriority) ,
then create thread and Use WaitForSingleObject(....) API function to determine when your task ended
.
if u need more help contact me on faroq_tam2004@yahoo.com.
If this dos'nt help u im sorry.
Bye.
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
hi CPians, toxcct again.
another wish i had for my prog was to have the possibility to switch all the text between French & English.
I so used the default string table (french) to insert the french strings, and created an US english for the translated strings. all the strings refering to the same thing in both tables had the same IDs (#define names).
Questions :
1. Am i right to set the same IDs (#define names) in the string in both tables, or do they only need to have the same value (int) ?
2. how can i switch from one language to the other and vice versa ?
3. Is there a better/simplest way to do this far away from what i am doing now ?
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Can't say whether it's the best way of doing it, but I use resource-only dlls.
How To Create Localized Resource DLLs for MFC Application
You should also search for "satellite dlls" at MSDN, I think there's an example project.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
In our app we have support for 3 languages (quite a drag and a lot of overhead)
We give the same names in the string tables for all three languages. (make 1, copy it and change the text)
When we change the language setting of windows our app switches too.
Good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
ok but, how to change the language while the application is running ?
i have a combobox with 2 entries ("Français" & "English"), and i would like (when a selection change is detected) to alter all the strings from one table to the other associated with the selected language.
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
In that case I would think ahead.
Load your captions dynamically with an xml document. This way you can add languages very easy in the future.
You should then still find a solution on what to do when your app changes etc. So maybe not a good track either.
I'm not sure it's so easy to what you want, maybe you can trigger the table-change, but I wouldn't know how , sorry.
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
i cannot do this with string table ressource ?? strange
if anybody knows... don't worry, tell me
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Hi .
u can create 2 Dll files with your resources and
then use API function to load your resources as u wanted.
On different Dll files u can use the same ID for the string.
that is mean only change the dll file for specific language.
for Example create Eng.dll file for English Version and
Frn.dll for France Version.
this make your program more esaer to development.
Bye.
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
What I did to solve this problem was put all the strings in a *.ini file (you could also use a *.xml file as suggested by V). By using this method, other people can add as many translations as they want, without you having to recompile your app or any extraneous dlls.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
hi CPians,
i have a strange fact. I'd like to add to my program a set of shortcuts (like Ctrl+O to open documents for example). i created the accelerator table and associated each shortcut with a menu item ; without effect.
What did i forget to allow my shortcuts to work ?
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Did you try calling LoadAccelTable on the CMainFrame class?
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
i use a dialog based app, and i think i already used LoadAccelTable(), without success.
do you have a piece of code to show me how to use it ?
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Ah, I thought you had built your own frame-oriented app.
For a dialog, see:
http://msdn.microsoft.com/msdnmag/issues/0700/c/default.aspx
About two-thirds of the way down the page...
Not to worry. You can easily add accelerators to any dialog just by mimicking CFrameWnd...
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
sorry but, can't find what i need...
i have a dialog box with a menu. in this menu, an item like this :
File > Open...
this item called ID_FILE_OPEN_MENUITEM should be associated with the combination of the Ctrl+O keys.
is there an easy way to do this ?
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Click on the Figure 2 link on the page I posted, it has the code for the CDlgWithAccelerators class.
Here's the direct link:
http://msdn.microsoft.com/msdnmag/issues/0700/c/figures.asp#fig2
All you need to do in your project is...
1) Add a new accelerator resource to your project. (let's say it's given the id IDR_ACCELERATOR1)
2) Add an accelerator shortcut in IDR_ACCELERATOR1 for ID_FILE_OPEN_MENUITEM that maps to Ctrl + O
3) Create an ACCEL variable in your dialog to store the accelerators when loaded (m_hAccel in his example)
4) In the OnInitDialog function in your dialog, load the accelerator table you created in 1).
i.e.
m_hAccel = ::LoadAccelerators(AfxGetResourceHandle(),
MAKEINTRESOURCE(IDR_ACCELERATOR1));
5) Create a handler for PreTranslateMessage in your dialog, and copy the PreTranslateMessage code from the DlgAccel.cpp sample to your dialog.
Works fine, I just tried it.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
thak you very much, that's much helpful now
cheers
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Hi all
I have a modeless dialogbox which is created in a SDI applic on which i have few ownerdraw buttons on one button i have written F4 and my requirement is when ever i click alt key on the keyboard along woth F4 button on the dialog About dialog box of EditView should open , what all messages do i need to send to my application to gennerate this event, i am making use of pretranslate message to check if the alt key is pressed on the key board
void MyDialog::OnButtonF4()
{
CTrailView *pView = (CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
if(0x8000 ==(0x8000 & GetKeyState(18)))
{
pView->SendMessage(WM_SYSKEYDOWN, 18, 1);
pView->SendMessage(WM_SYSKEYDOWN, 115, 1);
pView->SendMessage(WM_SYSKEYUP, 115, 1);
pView->SendMessage(WM_KEYUP, 18, 1);
}
}
BOOL MyDialog::PreTranslateMessage(MSG* pMsg)
{
if( pMsg->message == WM_SYSKEYDOWN && pMsg->wParam == 18)
{
CTrailView *pView = (CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
pView->SendMessage(WM_SYSKEYDOWN,18,0);
}
if( pMsg->message == WM_SYSKEYUP && pMsg->wParam == 18)
{
CTrailView *pView = (CTrailView *)((CMainFrame*)GetParent())->GetActiveView();
pView->SendMessage(WM_KEYUP,18,0);
}
return CDialog::PreTranslateMessage(pMsg);
}
can any one help me what to write in Alt key fuction or F4 func or in PreTranslte message
Request to all to continue this
|
|
|
|
|
Hello friends,
how can I know the height of a row in the listview and how can i set the height of the row at the runtime dependign upon the text.
Please help me regarding the above problem.
Thank you in advance.
Neelesh K J Jain.
|
|
|
|
|
Hi,
I replied to your other post about this a few days ago. Have a look at this article.
http://www.codeproject.com/combobox/listboxex.asp[^]
This is basically about making your own version of a control. It uses a listbox as an example, but its the same general idea with any control. The author works with height and width in it so that should help you out.
Getting back to your original problem, I think that there may be an easier way to get it to display. Either there is a property in the list control that controls this or there is a function that allows the text to display. If you click on a file you'll notice that it seems to toggle the text to on, and then when you switch to another file it goes back to the "...". So I think there's a function that you can use. However, if you have a lot of text, it will overlap with images below it, so you would have to adjust the row height as well if that's the case.
|
|
|
|
|
Can anyone please tell me .... how the m_pPushRoutingFrame member of CThreadState be NULL.
i mean i have an application when i close the ChidlFrame in it... i get an execption the reason is that the m_pPushRoutingFrame member of CThreadState in the destructor of CFrameWnd is NULL....
if anyone know anything about it please help... thankx in advance.
P.S there are no threading in my application.
shoaib.
|
|
|
|
|
Probably MFC tries to delete your CFrameWnd on application exit, but you have allocated it on the stack.
MFC expects that frame windows are 'automatically allocated' by the framework, as they are when you use the 'normal' MDI/SDI approach with the wizards. They get automatically deleted when the application shuts down.
Therefore, if you create a CFrameWnd manually, you have to allocate it via new and must not delete it on application exit. The framework does this for you...
This is one of the more obscure "features" of MFC, for which I never found any documentation...
Hope this helps,
Nick
EDIT: some typos
|
|
|
|
|
Can anybody please tell me how to set Unprotected Attributes of CMSG_ENVELOPED_ENCODE_INFO ? Thanks in advance.
|
|
|
|
|
Why the Spin button in MFC behaves oddly. It should increment the buddy value when we press the UP button and decrement by pressing DOWN. The button functionality is Invert of what it should be.
|
|
|
|