|
Thank you. But I just want to display text on toolBar
and m_wndTimerBar.SetButtonText( 0, "clock" ); won't show string on the toolBar. Please help.
|
|
|
|
|
I would guess the intention of the poster you responded to was that you could use the same technique used to put a combobox control on the toolbar to put a clock control on it. i.e. Make a clock window then follow the instructions in the article with adjustments to use your clock window instead of the combobox.
Steve
|
|
|
|
|
Thank you, is there a clock control?
|
|
|
|
|
Not that I know of. Making one would be trivial however. You could also do a search of the CodeProject and other sites to see if you can find a free one.
Steve
|
|
|
|
|
|
Most of these look a little big to fit on a toolbar.
Steve
|
|
|
|
|
please can anybody explain how to print text from an edit boxes. only the text, and how can you position that text on the paper wherever you want? tnx!
|
|
|
|
|
Do you need to print editbox value?
whitesky
|
|
|
|
|
|
I'm using VC++ 2005, and I'm getting a linker error about the MFC class CString. What library is CString contained in?
__________________________________________
Let's push Satan
|
|
|
|
|
|
No duh, I mean mfc42, mfc42u, mfco42, etc.
__________________________________________
Let's push Satan
|
|
|
|
|
that depends on your Unicode, Debug/Release, and static/dynamic CRT settings.
see the big #if/#else block near the top of AFX.H (C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\VC98\MFC\Include\AFX.H, on my installation)
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
I am building an open-source project, where first I have to build the base library(INDRI.lib). I successfully generate the base library file without any error. However, when I run the samples use that lib file, it creates LNK 2019 errors,
indri.lib(File.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void * __stdcall CreateMutexA(struct _SECURITY_ATTRIBUTES *,int,char const *)" (__imp_?CreateMutexA@@YGPAXPAU_SECURITY_ATTRIBUTES@@HPBD@Z) referenced in function "public: unsigned int __thiscall indri::file::File::read(void *,unsigned __int64,unsigned int)" (?read@File@file@indri@@QAEIPAX_KI@Z)
indri.lib(KrovetzStemmer.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned long __stdcall WaitForSingleObject(void *,unsigned long)" (__imp_?WaitForSingleObject@@YGKPAXK@Z)
indri.lib(Thread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) int __stdcall CloseHandle(void *)" (__imp_?CloseHandle@@YGHPAX@Z)
Can anyone suggest the solution of the problem?
Is it related socket library?
SKP
|
|
|
|
|
Are your samples being build as UNICODE builds?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
No.
All samples are being build as MultiByte Character Set(MBCS) builds.
Sac
|
|
|
|
|
Hi,
I am new to the forum. I am working on VC++ programming without using MFC... the code goes as follows
<the following="" code="" is="" inside="" the="" callback="" function="" of="" a="" dialogbox="" and="" run="" when="" start="" button="" pressed="">
<br />
<br />
for (frm=0;frm<frames;frm++){
<br />
sprintf(Messages, "Processing Frame... %d",frm+1);<br />
SendDlgItemMessage(hDlg,IDT_PROCESS_STATIC2,WM_SETTEXT,0,(LPARAM) Messages);<br />
SendDlgItemMessage(hDlg, IDP_PROCESS_PROGRESS, PBM_SETPOS, (WPARAM)frm+1,0);<br />
UpdateWindow(hDlg);<br />
<br />
<more processing code that has nothing to do with the dialog box><br />
}<br />
when the program runs the progress bar and the text gets updated when the dialog box is in focus. when I open another application or when I minimize the dialog box when it is running(i.e. when it looses focus) and then return back, it doesn't get updated. Can someone tell me what property of the dialogbox I might have missed...
Thanks,
Naresh.
|
|
|
|
|
When the application is obscured by another, and the for loop exits, does the progress bar and text update one last time? If so, this indicates your primary thread is too busy with the processing to handle the paint-related messages. You'll need to employ a secondary thread to do the processing so the primary thread can remain responsive.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
There are other lines of code within the for loop which are not related to paint-related messages and they are getting executed when the application is obscured. As you say, the progess bar and text are updated for about a second or so before it stops. I probably should start a secondary thread. Which of them should I move to the secondary thread? the process or the paint related messages?
|
|
|
|
|
Shrinaresh wrote: Which of them should I move to the secondary thread? the process or the paint related messages?
See here for a better understanding of "worker" threads.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks for the link... I shall read that and get back to you. Meanwhile, I am having one more problem. After WM_DIALOG is sent and the DialogBox is initialized, i want a button to be triggered automatically and the control to be transfered to the statements written for the button. How can I do that.
|
|
|
|
|
Shrinaresh wrote: After WM_DIALOG is sent...
Is this a user-defined message (UDM)?
Shrinaresh wrote: ...i want a button to be triggered automatically and the control to be transfered to the statements written for the button. How can I do that.
At the end of handling the WM_INITDIALOG message, post a message to the dialog. In the handler for that message, simply call the same function that clicking the button would call.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I meant WM_INITDIALOG. I am sorry. I tried posting the message within WM_INITDIALOG but the button is called even before the dialogbox is displayed and the processing starts... I want the button to be invoked after the dialogbox is displayed. How do I do that?
|
|
|
|
|
Show the WM_INITDIALOG code.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
case WM_INITDIALOG:<br />
SetDlgItemText(hDlg, IDT_PROCESS_STATIC2, "Waiting for input...");<br />
SendDlgItemMessage(hDlg, IDP_PROCESS_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM(0, frames)); <br />
SendDlgItemMessage(hDlg, IDP_PROCESS_PROGRESS, PBM_SETSTEP, (WPARAM)1,0);<br />
return TRUE;
now, if i add PostMessage(hDlg, WM_COMMAND, MAKEWPARAM(BN_CLICKED, IDB_PROCESS_START), LPARAM(hDlg)); before return TRUE; the button is clicked and the processing starts even before the Dialog Box is displayed... i tried SendMessage too, didnt work
|
|
|
|