|
I'm not quite sure how I should do this. I need it to blink, while the the rest of the application keeps running...which means I need to have a seperate thread for the blinklabel?
|
|
|
|
|
Not at all. Have you not used WM_TIMER before ? There is a tutorla here on how it's done, but the essence of it is on startup:
SetTImer(42,1000,NULL);
in OnTimer
if (nIDEvent==42) // I may have the variable name wrong ;0)
{
m_bFlash = !m_bFlash; // You need to create this
m_MyStatic.ShowWindow(m_bFlash ? SW_SHOW : SW_HIDE);
}
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
I am creating these four radio buttons dynamically.
The behavior is so random and confusing. At some point I got some text, and then I can't get it anymore. I have been told by friends at this forum that maybe the width is not enough, one time that fixed the problem but not anymore!!!!!!!
Here is the code:
if (OneGrpPosition != NULL)
{
pConfig->m_OneRadioBtn = (CRadioBtn *) (((CGrpBox*)pConfig->m_OneGrpBox)->m_GrpRadioBtn).GetNext(OneGrpPosition);
int len= ctrlRect.right - ctrlRect.left;
ctrlRect.right = ctrlRect.left +len+ 60;
if (ctrlRect.right >= 542)
::MessageBox(0, "Running out of screen width to display radio button", "Warning", MB_OK);
ctrlRect.bottom = ctrlRect.top + 25;
if (nDex == 0)
//
{
m_RadioButtonArray[nDex].Create((pConfig->m_OneRadioBtn)->m_RadioLabel,
WS_GROUP | WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, ctrlRect,this, (pConfig->m_OneRadioBtn)->m_RadioGuiID );
m_RadioButtonArray[nDex].SetFont(&m_font, TRUE);
}
else
{
m_RadioButtonArray[nDex].Create((pConfig->m_OneRadioBtn)->m_RadioLabel,WS_CHILD| WS_VISIBLE | BS_AUTORADIOBUTTON, ctrlRect,this,(pConfig->m_OneRadioBtn)->m_RadioGuiID);
m_RadioButtonArray[nDex].SetFont(&m_font, TRUE);
}
nDex= nDex+1;
ctrlRect.left = ctrlRect.right +10;
//This radio button has already been added to the memory structure
}
}
//This ia a new radio button that needs to be added to the memory structure
}
I am in Paradise.
Voltaire
|
|
|
|
|
what value is ctrlRect initialized with?
|
|
|
|
|
top=35
bottom=60
L=120
R=220
I have tried L=120 and Right = 170 through 220.
It is really confusing. Thanks for your time
I am in Paradise.
Voltaire
|
|
|
|
|
Are you sure the radio buttons gets created? Can you see the dot?
the if clause in your code is doing the same for both conditions... why?
|
|
|
|
|
Yes, I see all my four radio buttons are being created. The first one is different from the other three, because I need to have them in a group. Meaning if I click on of them the other three are unselected.
I do see the four of them being created. But no text next to them. I am thinking of just creating the first one to see if the text displays there.
It is a weird one. I really am looking forward to solve this one!!
Thanks again for your time.
|
|
|
|
|
It's very weird, but to my experiece this kind of bugs are really stupid.
Did you tried to use a hard-coded CRect for the creation, just to make sure it's not something else?
However, if you would send me a small demo project, I'll give it a look. I hate this kind of bugs!
Paolo.
|
|
|
|
|
Hi,
Is there a way that I can monitor all the operations in the clipboard(Copy/Cut - that happens on any application) and get notifications.
Thanks,
Ganesh.M.Ramaswamy
Ganesh.M.Ramaswamy
|
|
|
|
|
See my article ClipSpy for an app that monitors the clipboard.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
I have a progress bar in a CDialog and I want to step it as soon as the dialog becomes visible.
I can't do that in InitDialog, because the dialog is not visible yet.
Where would I do that?
Thank You
XP
|
|
|
|
|
how about OnShowWindow ?
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
I've begun to learn VC (MFC) few days ago.
i want to make something using the "ExtractIcon()" function.
the first paramter of this function (as written in MSDN) is a handle
to instance of the application.
How the hell do i get this handle? what should i send him as this first
parameter?
thanks a lot
RG
|
|
|
|
|
Call AfxGetInstanceHandle
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
look at this code:
...
HICON icon = ExtractAssociatedIcon(AfxGetInstanceHandle() , "D:\\file.fp", 0);
ASERT(icon==NULL)
static.Create(NULL, WS_CHILD|WS_VISIBLE|SS_ICON|SS_CENTERIMAGE, CRect(10,10,150,50), this);
static.SetIcon(icon);
...
static is CStatic variable.
i dont know why, but this code causes an error, the windows error message: "illigal operation" appears. and it happens only after i use this function....
have any ideas?
thanks
RG
|
|
|
|
|
Do you mean ASSERT(icon != NULL) ?
|
|
|
|
|
As above about ASSERT;
ASSERT(icon != NULL);
And also, the icon variable has to be present for the lifetime of the static control - thus you must put it as a member variable of the class, or as a global variable.
> Andrew.
|
|
|
|
|
You know, you COULD put it as a global variable... but then again, we also COULD write poor poor poor code...
If I were you, i would stick to putting it as a member variable of the Document class or the View class...depends on how it is used...
-Reid the C++/C# programmer
(Caution: I am a teenager, and that means that I think I know everything...but probably don't...)
|
|
|
|
|
Yes you're right about the global variable (obviously) but I said that because....hmmmm....don't know why I said that. You're right - it should be a member of the class that's using it.
Truth be told, the reason I said global variable was because I thought maybe he wasn't doing OOP programming, in which case that's pretty much the only alternative.
> Andrew.
|
|
|
|
|
you were right about the ASSERT parameter, but still, i dont understand why i get this error message, and it happens only because i used the AfxGetInstanceHandle() function.
Please heeelp!
thanks.
|
|
|
|
|
How can I create a toolbar whose buttons can be rearranged by drag/drop without needing to hold down any keys?
Also, another question: in VC++ 6, why can't I create a new MFC class that derives from CToolBar, only from CToolBarCtrl? I've gotten around this by creating the ToolBarCtrls and then changing the inheritance myself, which I don't think ClassWizard is too fond of.
thanks,
Jake
|
|
|
|
|
I can't answer to the first question, sorry.
As for the second... it's just what I did two days ago and it works well. May this could comfort you
After you replaced each occurence of CToolBarCtrl with CToolBar, make sure you delete the .clw file and start ClassWizard to create a new one.
Paolo.
|
|
|
|
|
Hi gurus,
Could somebody point me to some documentation for writing makefiles for use with nmake? Everybody seems to use thaem but I cant find any documentation...
Thanks
"A surprise to be sure, but a welcome one."
- Senator Palpatine
|
|
|
|
|
I need to get the current time only in 12 BYTE
2 BYTE - year
2 - month
2 - day
2 - hour
2 - minute
2 - second
|
|
|
|
|
Call GetSystemTime() which returns the date/time in a SYSTEMTIME struct. SYSTEMTIME has the values in WORDs, which are 2-byte unsigned ints.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|