|
this pice of code doesn't work
<br />
case LVM_INSERTITEM:<br />
{<br />
LV_ITEM FAR* pitem = (LV_ITEM FAR*) lParam;<br />
if(!pitem && !pitem->pszText)<br />
break;<br />
<br />
if( pitem->mask & LVIF_TEXT == LVIF_TEXT && pitem->cchTextMax>0) <br />
{<br />
MessageBox(okno,pitem->pszText,":-)",MB_OK); <br />
}<br />
break; <br />
any other ideas
Pain is a weakness living the body
|
|
|
|
|
Try using brackets to delimit each expression you are testing in the if statement.
Bikram Singh
|
|
|
|
|
What happens if pitem != NULL and pitem->pszText = NULL?
(Hint: It wont break)
I would do the test:
if(pitem && pitem->pszText)
{
// Do the dance...
}
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Not working hmmm hardcore hehe.
Im testing changing iImage value according to iItem and it seems to be good if I know sequence of adding apriori, which will require some more coding. Anyway its really strage stuff isn't it
Pain is a weakness living the body
|
|
|
|
|
Try this
case LVM_INSERTITEM:
{
LPLVITEM pitem = (LPLVITEM) lParam;
if(pitem && pitem->pszText)
{
if( ((pitem->mask & LVIF_TEXT) == LVIF_TEXT))
{
MessageBox(okno,pitem->pszText,"",MB_OK);
}
}
break;
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Not working. Plese remind me next time do not take a project for windows.
Pain is a weakness living the body
|
|
|
|
|
But I thing I know why is it so. According to spy ++ this is a ATL:SysTreeView control. Maybe as a lparam they are sending some other struct than LV_ITEM
Pain is a weakness living the body
|
|
|
|
|
Where is it crashing?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Im hooking into OE and it crashes when OE adds new items to address list. when i use olny iImage eg iImage = 2 it works properly but i want test pszText vaule and according to this set proper valus of iImage
Pain is a weakness living the body
|
|
|
|
|
I would do:
<br />
if(pitem)<br />
{<br />
if(pitem->pszText)<br />
{<br />
}<br />
} <br />
Bikram Singh
|
|
|
|
|
not working too i think this not valid pointer beacuse its not the same address space I had the similar problem some time ago when i wannted to send some char * as wparam or lparam using SendMessage. I had to use WM_COPYDATA then char * goes thru kernel memory and pointer is valid
Pain is a weakness living the body
|
|
|
|
|
Iam catching shift key in pretranslate function and i want to disable the shift key( make the shift key up). i..e i want to disable shift key functionality. How to do it?
Thanx in advance.
Lokesh
|
|
|
|
|
<br />
SetFocus(hwnd);<br />
<br />
keybd_event( VK_SHIFT,0x45,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);<br />
check if SetFocus is nesserly in your problem
Pain is a weakness living the body
|
|
|
|
|
I want to create a pipe. However, I don't want my app to just sit forever waiting for a client to connect. Do I use the overlap setting and the NO_WAIT (non-blocking) flag when I create the pipe? I was thinking of doing a loop with the connectnamedpipe and getoverlap func and flag check to see if the user wanted to quit out of the server app before a connection to a client was made. Is this a good idea?
|
|
|
|
|
In a "class CMyCtrl : public CWnd" controller I create another controller dynamically.
Can I catch the WM_LBUTTONDOWN message that is intended for the dynamic controller in CMyCtrl instead?
/Mathias
|
|
|
|
|
<br />
<br />
(WNDPROC) gfnMyProc;<br />
gfnMyProc = (WNDPROC)SetWindowLong(listview, GWL_WNDPROC,(LONG)MyProc);<br />
<br />
LRESULT CALLBACK MyProc(HWND hwnd, UINT uiMsg,WPARAM wParam, LPARAM lParam)<br />
{<br />
switch (uiMsg)<br />
{<br />
case WM_LBUTTONDOWN:<br />
{<br />
<br />
break;<br />
}<br />
}<br />
return CallWindowProc(gfnMyProc, hwnd, uiMsg, wParam, lParam);<br />
}}<br />
Pain is a weakness living the body
|
|
|
|
|
This should work
<br />
<br />
(WNDPROC) gfnMyProc;<br />
gfnMyProc = (WNDPROC)SetWindowLong(listview, GWL_WNDPROC,(LONG)MyProc);<br />
<br />
LRESULT CALLBACK MyProc(HWND hwnd, UINT uiMsg,WPARAM wParam, LPARAM lParam)<br />
{<br />
switch (uiMsg)<br />
{<br />
case WM_LBUTTONDOWN:<br />
{<br />
<br />
break;<br />
}<br />
}<br />
return CallWindowProc(gfnMyProc, hwnd, uiMsg, wParam, lParam);<br />
}<br />
Pain is a weakness living the body
|
|
|
|
|
I would like to do a particular operation every 1 minute.How can I set the program so that this is done automatically?Please Help!!!
|
|
|
|
|
SetTimer() is the simplest way. You can create a timer which will send a WM_TIMER message every 60000 milliseconds.
|
|
|
|
|
You could also have it notify a static function, rather than send the message through the message loop, if desired.
|
|
|
|
|
Hi,
I´m working with a CListCtrl control using a CImageList. The size of my list is limited to 200 items by using DeleteItem(0) when GetItemCount>200. Everything seems to work fine but the memory my app is taken from the system. It seems that the system does not free the memory allocated for each item when it is deleted.
Can anybody help me about this?
Thanks a lot.
|
|
|
|
|
munguia wrote:
It seems that the system does not free the memory allocated for each item when it is deleted.
If you have a delete for every new , your application is behaving properly. It's highly unlikely you'd see the memory footprint of your application decrease until the application is closed. That does not mean, however, that less memory is available. For a more detailed spin on this, read here, especially the last section.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
It should work!
if u use CListCtrl object as a data member of a view or dialog class, it is destroyed when its owner is destroyed. If you use aCListView, the framework destroys the control when it destroys the view.
lokesh
|
|
|
|
|
Hi,
Are you using SetItemData to store pointer to objects? If so, have you remembered to delete them before removing the item from the list?
Also, have you included:
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
to your .cpp files so that you can track the new's and trace the leaks?
Cheers,
Andy
|
|
|
|
|
I need to put three different forms in SDI application's CView window so that user can choose which view he wants to see. If I make 3 different CFormView classes how do I select one to be shown in a CView window?
|
|
|
|