|
While your hack (mentioned in another post) doesn't seem too egregious to me, another possible solution could be to add more template function overloads - I'm just showing max here:
namespace std {
template<class A>
bool max(int const& a, A const& b) { return a>b?a:b; }
template<class A>
bool max(A const& a, int const& b) { return a>b?a:b; }
}
These should take care of the cases in your header that aren't compiling with the STL min function, as (if you read the error messages) one of the types involved is always int.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi just include
#include <iostream>
#include <algorithm>
to your source file and this should be easily solved
|
|
|
|
|
No. Notice I suggested defining partially specialised templates, not the ones in <algorithm> - this is because the OPs problem was because of a template parameter deduction failure due to a mix of LONG and int parameters being passed to min/max.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
int DrawShadowText(HDC hdc,
LPCWSTR pszText,
UINT cch,
const RECT *pRect,
DWORD dwFlags,
COLORREF crText,
COLORREF crShadow,
int ixOffset,
int iyOffset
);
1. What 's "DWORD dwFlags" use for?? In MSDN document, They just tell "A DWORD that specifies how the text is to be drawn."
2. How can i align text when i use this function????
|
|
|
|
|
Maybe try the possible values for nFormat descibed here[^] (like DT_LEFT, DT_TOP, ...).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
You can see on Adv. Win32 group [^]
(they have source code (C) for all Win32 apis...)
|
|
|
|
|
I want to draw a disabled icon. I try this:
CPoint point(10,20);
CSize size(16,16);
CBrush brush(RGB(255,0,0));
pDC->DrawState(point,size,hIcon,DST_ICON | DSS_DISABLED,&brush);
The "size" isn't correct. I want to draw 16x16, but it's alway larger. Why?? Please help me!!
If can't, help me to draw disabled icon (size 16x16)!!!
modified on Sunday, August 30, 2009 2:33 PM
|
|
|
|
|
How did you get hIcon ?
Try and use LoadImage with 16 as the cxDesired and cyDesired parameters.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
hi ... can anyone advice me how to make a graphical text editor in c++ without using microsoft foundation classes....please help
|
|
|
|
|
|
hey dude...thanks for the reply...but i dont want to use win32 api either....if u can just tell me how..to go about creating a graphical text editor in c++ without using mfc or win32 api...that would be more than sufficient....thanks in advance!!
|
|
|
|
|
It sounds as if either:
1. Your question is a joke, or
2. You don't know what you're talking about
If you don't want to use the Win32 API, then what are you imagining you would use?
|
|
|
|
|
What exactly are you going to use, then, magic fairy dust?
|
|
|
|
|
is it possible to use it ...aneyways was planning to make it using graphics.h...but i think using win32/mfc would be a better option..it might be tough in the starting...but in the long run its going to be a better thing to work on..thanks a lot guys....for ur valuable suggestions
|
|
|
|
|
Hello,
I want to place the caret position at the end of the text in a CRichEditCtrl. But when it naturally moves to the CRichEditCtrl box the caret is placed at the beginning.
I tried the message EM_POSFROMCHAR but it takes one character and gives its position and I cant give that last one character as it can repeat in between somewhere.
How should I place the caret at the end?
I hope my question was clear.
Thanks for the codeproject forum.
Pritha
|
|
|
|
|
You cannot move the caret using SetCaretPos() for CEdit and CRichEditCtrl. INFO[^]
To move the caret use SetSel and specify the same start pos and end pos.
Example:
...
int p=m_RichEditCtrl.GetWindowTextLength()-1;
m_RichEditCtrl.SetSel(p,p);
...
Hope that helps.
|
|
|
|
|
|
my program is the following
int m_nCurFrame;// extract the current frame from avi file
int m_nMax; //total frames in the avi file
BOOL bb;
CXXView::CXXView
{
bb = FALSE;
}
void CXXView::OnAutoProcessing()
{
while (m_nCurFrame++ <m_nMax)
{
if(bb)
{
break;
}
.......//procesing
}
}
~CXXView::CXXView
{
bb = TRUE;
}
when i exit this program, the program enter the ~CXXView, then enter OnAutoProcessing(),because the object is dead,so the program is wrong,but i want to exit the programentoirly,can you give me some advices?
thanks!!!!!!
In near day,I want to change the TITLEBARINFO of my Program?
My code is following:
#include "winuser.h"
...........
...........
TITLEBARINFO bti;
bti.cbSize = sizeof(TITLBARINFO);
GetTitleBarInfo(GetParent()->m_hWnd,&bti);
But i can't compile these codes,can you tell me how to do?
My program is developed by VC++6.0 under Winxp.
|
|
|
|
|
I'm a little confused...
Do you have a function, like:
delete pXXView;
pXXView->OnAutoProcessing ();
If so, that's your own silly fault, and we can't help you *not* do stupid stuff.
Being CSomeView::On____ () sounds a lot like a message handler from a menu / toolbar button. If so, how does it get called after the view's destructor?
You need to explain some of the glue. If you don't know the answer either, put a breakpoint at the start of OnAutoProcessing, and then look at the call stack to see how it got called.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Does OnAutoProcessing run in a separate thread?
If so you should wait till the thread exits in the destructor after setting the bb variable to TRUE .
You can use the GetExitCodeThread function to check if the thread status is STILL_ACTIVE .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi There,
Please let me know some good freelancing websites from where I can get project and earn some money.
Its very urgent please help me.
Best Regards,
AIS
|
|
|
|
|
Hi.
Apologies for not knowing English language well.
I develop an application (with VC++)that run Microsoft Office Word 2007 that open a doc file automatically. I want to prevent user file opening.In other word I want to limit user to can not see File Open window. But I don't know any idea to do that?
If you can , please help me.
Thanks a'lot.
modified on Tuesday, September 1, 2009 6:30 AM
|
|
|
|
|
no way.
open the file with windows api into the memory instead of opening it with office interface
it's my pleasure to make friend with you.
|
|
|
|
|
Wrong. You can do it by hooking.
|
|
|
|
|
Hello to everyone,
I am a C programmer for one week only...
In my work I have to do (urgently) a code to calculate the Fast Fourier Transform of a discrete signal (1D)(to calculate FFT from some discrete values).
I have visited some web sites but I don´t have found any clear answer for it.
Could anyone lend me a source code to calculate it or any other help, please?.
I was very grateful to anyone who can help me.
Thanks in advance,
Kind regards.
My mail: programmer202@gmail.com
|
|
|
|