|
I always use this: Control Library[^]
The equivalent location in the platform sdk is User Interface/Windows Controls/Individual Control Information
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark for reminding me about “the other MSDN” !
Can I download it and retire my 2001 version?
Just kidding.
Unfortunately the tab control knows nothing about spinner control.
Maybe I am imagining things how they work together. Maybe they don’t.
I’ll keep digging around.
Cheers
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: Unfortunately the tab control knows nothing about spinner control.
What do you mean? They are two different controls (by spinner, you mean
up-down control, right?)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
BTW, I've never seen any messages related to the up-down control that
a single-row tab control adds when there's too many tabs for the window width.
I don't know if there's any direct control available.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
I finally found how it is done. It was under my nose all this time.
The style options / parameter TCS_SINGLELINE brings in horizontal spinner control when the tabs do not fit into frame - pure magic! Of course the documentation does not say that verbatim.
I am still hacking the downloaded code to find how to replace
tab painfully created from scratch with tab created using CTabCtrl.
For now I consider this post solved - thanks to you Mark.
You get a star!
Here it is:
CTabCtrl::Create(WS_CHILD|WS_VISIBLE|(m_bTop?0:TCS_BOTTOM)| TCS_SINGLELINE
|TCS_FOCUSNEVER|TCS_FORCEICONLEFT|WS_CLIPSIBLINGS,
CRect(0, 0, 0, 0), pFrame, 42);
Cheers
Vaclav
|
|
|
|
|
Cool!
FYI...here's the only info I see in the SDK:
"If not all tabs can be shown at once, the tab control displays an up-down
control so that the user can scroll additional tabs into view. You can cause
a tab control to display multiple rows of tabs, if necessary, by specifying the
TCS_MULTILINE style. With this style, all tabs can be displayed at once."
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi there,
how can i check whether my application runs already or not on the system (OS),
so that if i try to start the application again,
instead of start a new instance of the application,
then just bring the application to the foreground.
thanks
|
|
|
|
|
|
Hamed Mosavi wrote: // "Life is very short and is very fragile also." Yanni
while (I'm_alive)
{
cout<<"I love programming.";
}
These many compilation errors in your small code. Are you a true lover of programming
error C2001: newline in constant
error C2015: too many characters in constant
error C2143: syntax error : missing ';' before 'constant'
error C2143: syntax error : missing ';' before 'while'
error C2001: newline in constant
error C2015: too many characters in constant
error C2143: syntax error : missing ')' before 'constant'
error C2143: syntax error : missing ';' before '{'
Sreedhar DV
[Real success is having courage to meet failure without being defeated.]
|
|
|
|
|
Sreedhar DV wrote: These many compilation errors in your small code
Oh my god! Did you really compile that!
I knew one day that happens. Someone notices the ' in I'm. I decided to put it there so that it would be more readable by non programmer members. It used to be 'Printf("...' and someone claimed it's better to use cout (because of it's performance! performance in CP!) Now if I remove that ' as well, I guess only programmers understand it;)
I decided to leave it to be, after all no one(?) is to compile or use this.
Sreedhar DV wrote: Are you a true lover of programming
Yes! Enough lover to continue coding for 6 years even when I don't earn enough money from that.;)
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
In all my years of doing software, this is the first time I've done a modeless dialog.
It works kinda -- the static text and progress bars are updating. But it's not getting it's other messages...
* WM_TIMER doesn't get there
* my button won't press
* the hourglass is up the whole time...
How do I get it to pump it's messages?
The dialog was created in a thread -- was wondering if that plays a role?
I did play with RunModalLoop -- but I am not sure that's what I really want to do????
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
If you provide the code you used to create and display the dialog, it's more likely to get answered.
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Peter Weyzen wrote: The dialog was created in a thread -- was wondering if that plays a role?
Definitely. That thread needs to have a message loop and it sounds like your thread
doesn't.
You can either
a) change your thread to a UI thread
b) create the dialog on the app's UI thread.
In the case of a progress dialog, the second alternative is probably easiest. Let the
UI thread that's already in place handle the window messages and let the worker thread
do its intended work. Use PostMessage() from the worker thread to communicate
with the dialog.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: That thread needs to have a message loop and it sounds like your thread
doesn't.
Then what about his "...the static text and progress bars are updating" statement? Wouldn't those, too, fail to update without a message loop.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Messages sent with SendMessage() will get to the control.
If the control handles the message with an immediate redraw
then it will "work".
For example. I'm pretty sure progress bar controls redraw themselves
immediately when you send a PBM_SETPOS message to them, although
that's nothing I'd rely on.
(*edit: Actually the PBM_SETPOS is documented as redrawing the control to reflect the change)
The timer and mouse messages queued by the sytem, however,
won't get to the control without being dispatched.
That's my take based on the info provided
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That's true -- I was able to update controls on the dialog.
The obvious clues were:
* WM_TIMER wasn't getting delivered
* dialogs controls wouldn't take input (couldn't click the buttons)
It would display data just fine, I just couldn't interact with the dialog.
Thanks again.
I guess I am not a dumb as I feel sometimes -- muddling through MFC.
I love CodeProject! It's truly the first place I go to look for answers or sample code. I think I've been a member for 6 years...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
After lunch and thinking about it, if your window displays, then the thread
it was created on must have a message loop. If you go into lengthy
processing on that thread without pumping messages, however, you'll
still get the behavior you described.
Cheers
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: After lunch and thinking about it, if your window displays, then the thread
it was created on must have a message loop.
I suggest you stop thinking so hard. Try this program:
#include "stdafx.h"
#include "resource.h"
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return FALSE;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
HWND hDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, &DialogProc);
ShowWindow(hDlg, SW_SHOWNORMAL);
Sleep(10000);
return 0;
}
There is no message pump but the window displays.
Steve
|
|
|
|
|
Cool! I guess a LOT of messages get sent instead of posted.
But I'm not going to think about it
Well, the buttons won't work!
Thanks!
MArk
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Just to make sure I'm not nuts, I tried this:
m_ProgressCtrl.SetRange(0, 100);
for (int i = 0; i <= 100; ++i)
{
m_ProgressCtrl.SetPos(i);
CString str;
str.Format(_T("%d"), i);
m_Static.SetWindowText(str);
::Sleep(10);
} No messages are pumped during the loop, but the 2 controls update fine.
Of course, that doesn't verify I'm not nuts, but hopefully clarifies what I was
talking about
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for clarifying. I've always gone the secondary thread route.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I just broke for lunch, and I wondered - how does the window with
the controls get displayed to start with without a message pump?
LOL
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you very much for the insight.
MFC still baffles me at time... but there was obviously no hook-up between my dialog and the app's message pump. Everything else in the dialog was pretty standard from the CP sample code.
Anyhow, I'll give that a try.
Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
hello ,
I am creating a optional setup dll for my installation. I am not able to use this set up file with my Win CE CAB file. the setup.dll exporting following function :-
Install_Init
Install_Exit
Uninstall_Init
Uninstall_Exit.
can any body help me how to use this dll in my CAB file.
thanks,
Yudhisthira Attry
|
|
|
|
|
OK, before all you VC++ gurus get too exited about seeing this post here - I would like to reach widest technical audience possible.
My reasons for posting here are personal and selfish and I’ll delete this post if there are objections from you.
I am getting really frustrated with MS RAID 5 implementation on my Widows Advanced Server. Don’t flame me running this OS – I cannot afford troubleshooting MS latest OS and my buggy VC++ code same time!
This is not MS bashing article.
I am looking for real experts in software RAID technology to help me develop different RAID than is currently available on Windows 2000 Advanced server. I do not want to discuss pro and cons of different RAID methods and hardware (PCI) solutions. I am not interested in Linux solutions.
Here is my OpenRAID project spec:
1. RAID 5 with user interface to enable array updates on request.
Reason:
MS RAID will take over the PC after power failure and cannot be stopped.
MS RAID is always working – not required.
2. RAID 5 that would allow building RAID 5 for operating system thus allowing PC to boot from any drive (including USB).
Reason:
MS RAID does allow OS to be mirrored only – not RAID 5.
After OS drive failure the only recovery is to rebuild the OS drive from scratch – too time consuming and scary. (Does it matter what nationality is a foreign disk?)
3. RAID 5 extended over USB or FireWire interface
Reason:
MS RAID does not work with any external interfaces. (MS reasoning for this is irrelevant)
The data redundancy is my primary goal.
The speed of the USB or other interface is unimportant.
Copy internal drive to external dynamic <big></big>drive for preventive replacement.
Build dynamic USB disk
4. Identify which disk caused the RAID 5 failure.
5. Current RAID is flaky on OS power down during rebuild process and makes system unusable after power failure.
I just want to add new life to the OS technology that did not kept up with the hardware developments.
Anybody for a challenge?
Thanks for your time.
Cheers
Vaclav
|
|
|
|