|
Nice article. Thank you!
|
|
|
|
|
Click, ItemSelect, etc.?
I've noticed that when you click it or do some action on it, i don't get a WM_COMMAND message and i don't get the name of the control in the wParam parameter.
Thanks
|
|
|
|
|
Select the control in ClassWizard and choose a notify message handler for the appropriate notification.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello,
Here is some code.. I am trying to double buffer my CListView MDI app.. I am getting all kinds of really weird drawing.. Alot of this code is from a CListCtrl double buffer.. I am trying to use it.. Anyone want to see if they can find some problems.. Thanks!!!
CRect rc;
GetParent()->GetClientRect(&rc);
if (rc.Size() == CSize(0,0))
return;
CPaintDC dc(this);
CDC MemoryDC;
CBitmap Bitmap;
CBrush Brush;
CRect rcWnd;
GetWindowRect(&rcWnd);
int rcWndW = rcWnd.Width(), rcWndH = rcWnd.Height();
MemoryDC.CreateCompatibleDC(&dc);
Bitmap.CreateCompatibleBitmap(&dc, rcWndW, rcWndH);
CBitmap *pOldBitmap = MemoryDC.SelectObject(&Bitmap);
Brush.CreateSolidBrush(RGB(255,255,255));
MemoryDC.FillRect(&CRect(0,0, rcWndW,rcWndH), &Brush);
CWMPaintHook hookHeaderCtrl(GetListCtrl().GetHeaderCtrl()->GetSafeHwnd(), MemoryDC);
Print(&MemoryDC, PRF_CLIENT|PRF_CHILDREN);
Print(&MemoryDC, PRF_NONCLIENT);
CRect rcDraw = rc - rc.TopLeft();
dc.BitBlt(rc.left,rc.top, rc.Width(),rc.Height(), &MemoryDC, rcDraw.left,rcDraw.top, SRCCOPY);
MemoryDC.SelectObject(pOldBitmap);
If you need more code, like from my .h let me know and I'll post it.
Thanks,
Rob
|
|
|
|
|
Never mind.. I just figured it out
|
|
|
|
|
Is there a class or function out there will let me pass in an string equation like "(5/12)*8" and have it return the answer as a double.
I am planning on writing a fuction to do this, but thought I would check here first.
Thanks in advance.
***********************
Tony Fontenot
Recreational Solutions
tony@recsolutions.com
***********************
|
|
|
|
|
What you want is an expression parser. There are several commercial ones available, but none I would recommend.
Alexander Berthold has published one here on CP, but I have not used it personally. It can be found here:
http://www.codeproject.com/cpp/cxtpackage.asp
|
|
|
|
|
here's one: http://www.codeproject.com/cpp/functionparser.asp
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
When i write this
typedef map<int, string, less<int>, allocator<string> > strmap;
which is what the MSDN library sample does, then i get an error:
error C2143: syntax error : missing ';' before '<' like it's not expecting the "<" even though when i write the <, one of those things appear that helps you find the parameters of a function...
What's wrong?
Thanks
|
|
|
|
|
did you:
using namespace std;
or
typedef std::map<int, std::string, std::less<int>, std::allocator<std::string> > strmap;
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
it says that string isn't a member of std, can i write this instead?:
typedef std::map<int, char, std::less<int>, std::allocator<char> > strmap;
|
|
|
|
|
that will associate an int with a single char.
try this:
#include <string>
#include <map>
typedef std::map<int, std::string> strmap;
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
How do i retrieve the value again? How do i for example fill a char array with the value using strcpy?
Thankyou, your help has been greatly appreciated!
|
|
|
|
|
here's the lookup:
strmap::iterator it = myMap.find(intKey);
if (it!=myMap.end())
{
char *pChar = new char[(*it).second.size() + 1];
strcpy(pChar, (*it).second.c_str());
...
delete [] pChar;
}
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
|
Hi,
I'd like to find out if my application should start normal, minimized or maximized (as configured in start menu or explorer shortcut)?
In the application's InitInstance() I would like to detect this.
thx 4 help
|
|
|
|
|
|
m_pMainWnd->ShowWindow (m_nCmdShow);
m_pMainWnd->UpdateWindow ();
I see, thx.
PS: is there also a way to get the filename or something similar?
I like to create a (invisible) CFrameWnd and neet to set a dummy string for window name, unfortunately it is shown in the tasklist of C++ spy.
|
|
|
|
|
Look up the CWinApp class in MSDN. you will be interested in the data members of the class.
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Orgasms are universal!! -- Mike Mullikin in The Lounge 21:27 15 May '02
|
|
|
|
|
I am trying to create a simple CEdit in a CWnd
the problem is that the editbox is 2D
I am using this
p->Create(WS_TABSTOP | WS_BORDER |WS_VISIBLE | ES_AUTOHSCROLL | ES_LEFT , rect, this,IDC_EDIT);
SetWindowLong(p->m_hWnd, GWL_EXSTYLE,WS_EX_CLIENTEDGE);
can someone help ?
thanks
Casa.Sapo.pt
|
|
|
|
|
You have to use CreateEx with the WS_EX_CLIENTEDGE extended windows style.
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Orgasms are universal!! -- Mike Mullikin in The Lounge 21:27 15 May '02
|
|
|
|
|
|
If you want to do it with SetWindowLong() (although ModifyStyleEx() would be a better function to use) you have to force the control to redraw itself with a call to RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW)
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Orgasms are universal!! -- Mike Mullikin in The Lounge 21:27 15 May '02
|
|
|
|
|
Can anybody help me to export a Microsoft Word documents to XML ?
Thanks.;)
Aziz Rajim
|
|
|
|
|
Hopefully this will help you get a start ...
http://www.perlmonks.org/index.pl?node_id=113635
|
|
|
|