|
abac_mefisto wrote: c1xx : error C3174: module attribute was not specified
Error description[^] for this describes about missing module attribute. Have you checked it ?
|
|
|
|
|
Thank you for your hint; where do I have to set the module attribute, in the source code or through properties of the project ?; for the lua library?
What do you mean underneath writing Notifier using ATL.
Hope to hear you again
Marco
marcof
|
|
|
|
|
abac_mefisto wrote: where do I have to set the module attribute
I guess, compiler should tell you that. For whihc clss/structure/interface error is appearing.
abac_mefisto wrote: What do you mean underneath writing Notifier using ATL.
Its my signature, about my article.
|
|
|
|
|
Thankyou for the hint. Where do I change the module attribute, in the source code or from properties of the project? for the lua library ? It seems that the acceptable attributes are dll, exe or server not library.
Hope to hear you again
Marco
marcof
|
|
|
|
|
Hi,
I need to paint background of a CWnd derived class. how to do that ??
thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
I'm not sure about your intention. But, doesn't WM_PAINT solve your purpose ? What do you mean by background of a window ?
|
|
|
|
|
prasad_som wrote: doesn't WM_PAINT solve your purpose ?
Its better to draw background color in WM_ERASEBKGND message handler
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
Did you refered WM_CTLCOLOR and WM_ERASEBKGND
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
yes I tried in OnEraseBkgnd but no use
BOOL CClrCatalogWnd::OnEraseBkgnd(CDC* pDC)
{
if(m_hbrBackground)
DeleteObject(m_hbrBackground);
m_hbrBackground = CreateSolidBrush(RGB(100,100,100));
pDC->SelectObject(m_hbrBackground);
return CWnd::OnEraseBkgnd(pDC);
}
What to do in OnCtlColor??
Today is a gift, that's why it is called the present.
|
|
|
|
|
Change the implementation as below
BOOL CClrCatalogWnd::OnEraseBkgnd(CDC* pDC)
{
if(m_hbrBackground)
DeleteObject(m_hbrBackground);
m_hbrBackground = CreateSolidBrush(RGB( m_nSliderPos, m_nSliderPos, m_nSliderPos));
CRect rc; GetClientRect( rc );
::FillRect(pDC->m_hDC, rc, m_hbrBackground);
return TRUE;
}
narayanagvs wrote: What to do in OnCtlColor??
if nCtlColor is equal to CTLCOLOR_DLG, then you have to return the HBRUSH to paint the dialog.
It seems that you are changing the background color, depending on the slider value, if so, just return TRUE in OnEraseBkgnd(..) and do the above implementation in OnPaint handler
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
Hello,
I have a
enum Frame_Type{EMPTY_FRAME,TABLEVIEW};
class A
{
const FRAME_TYPE FrameType0;
const FRAME_TYPE FrameType1;
AddFrame(const FRAME_TYPE tFrameType);
};
AddFrame(const FRAME_TYPE tFrameType)
{
switch (tFrameType)
{
case FrameType0 :
int g=1;
break;
case FrameType1 :
int g=2;
break;
}
}
The AddFrame function gives error saying 'case expression not constant'
|
|
|
|
|
As error indicates, case should be constant, not a variable as in your case. Probably, you wanted to modify your code like this,
class A
{
const FRAME_TYPE FrameType0;
const FRAME_TYPE FrameType1;
enum FRAME_TYPE{EMPTY_FRAME,TABLEVIEW};
AddFrame(const FRAME_TYPE tFrameType);
};
AddFrame(const FRAME_TYPE tFrameType)
{
switch (tFrameType)
{
case EMPTY_FRAME :
int g=1;
break;
case TABLEVIEW :
int g=2;
break;
}
}
|
|
|
|
|
I have created an MFC dockable toolbar, and put a combobox control as the
last element in the toolbar, the toolbar won't size correctly when i dynamically resize it when it is un-docked. I mean, the combobox will not be visible after resize.
Any Solutions.
Thanks
|
|
|
|
|
|
I will try using CalcDynamicLayout().
Thank you very much for nice link.
|
|
|
|
|
|
Programm3r wrote: I know that all perform the same function
They don't.
FIRST checks if functionOne is equal to 0
SECOND and THIRD checks if functionOne is less than 0
I can't see any reason to use THIRD, it's just confusing. Why assign a value from one variable to another, just to check its value? Anyway, the optimizer would omit the assignment, provided that the value of rc and functionOne isn't assigned another value later on in the code.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Programm3r wrote: I know that all perform the same function:
Actually, the above sentence it's not true.
Of course
if (functionOne<0)
...
int rc = functionOne;
if (rc<0)
...
Performs the same (i.e. do things if functionOne return value is less than zero). On the other hand,
if (!functionOne)
...
(i.e. do things if functionOne return value is equal to zero) it's completely different.
That said, I think THIRD it's a bit redundant, but handy to inspect functionOne return value when debugging.
Hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: but handy to inspect functionOne return value when debugging
What's wrong with just putting the cursor on functionOne while debugging?
That will show it's value in VS.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
kakan wrote: What's wrong with just putting the cursor on functionOne while debugging?
There's nothing wrong, of course.
However maybe handy (handy, I repeat), if putting the cursor on functionOne is not that easy (suppose the function is inside a DLL...).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
True. I missed that functionOne is a function, and not a variable.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Thank you for clearing that one up ... So if I understand correctly:
bool a = false;
if (!a)
int b = -2;
if (!b)
CPallini wrote: Hope that helps.
Yes it did, thanks again.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Well...
When it comes to bool values, they are defined as this (if I remember it correctly):
false is always 0, zero.
true is any other value, can be -1 (VARIANT_BOOL) or 1 (true, TRUE).
But stricly, if it has got any other value than 0, it's true.
So if you want to follow the rules, while working with bool variables, always test for zero or not zero.
Test for zero/false:
if (!a), or if(0 == a), or if(a == 0)
Test for true:
if (a), or if(0 != a), or if(a != 0)
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
You're a bit confused, anymore.
if b is declared as an int , then
if ( ! b )
{
}
executes the code inside the block if and only if b==0 , because C/C++ consider a non-zero valued int as true (a zero valued int as false ) and ! is the logical negation operator.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Another trap I have seen beginners make is
int b;
if (b == TRUE)
{
}
is different to
if (b)
{
}
.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|