|
Hello gurus
I need to serialize an STL type called valarray but the the Serialize function is giving me errors regarding the << and the >> operator is there anyway or alternative to get over this thing please help
Regards
Ahmed
|
|
|
|
|
Anybody use frames in dhtml ed control. Plz give suggestion.
lokesh
|
|
|
|
|
"Hi I'm developing dll which will do some changing stuff with ListView. I have a funny problem I want to change value of iImage in a LV_ITEM according to pszText value. Problem occurs when I want to test value of pszText, exception ouccrs Access Violation 0xC0000005 But I'm testing if pitem and pitem->pszText are not null even if I tryed to use strdup(pitem->pszText) the same exception occurs. There is no problem when I tryed to change value of iItem. Is is somehow connected witch injection dll into some application ?? and its address space ??
"
<br />
(WNDPROC) gfnListProc;<br />
gfnListProc = (WNDPROC)SetWindowLong(listview, GWL_WNDPROC,(LONG)ListProc);<br />
<br />
__declspec(dllexport) LRESULT CALLBACK ListProc(HWND hwnd, UINT uiMsg,WPARAM wParam, LPARAM lParam)<br />
{<br />
<br />
switch (uiMsg)<br />
{<br />
case LVM_INSERTITEM:<br />
{<br />
LV_ITEM FAR* pitem = (LV_ITEM FAR*) lParam;<br />
if(pitem && pitem->pszText)<br />
MessageBox(0, pitem->pszText,":-)",MB_OK); <br />
<br />
break;<br />
}<br />
}<br />
return CallWindowProc(gfnListProc, hwnd, uiMsg, wParam, lParam);<br />
}<br />
<br />
<br />
typedef struct tagLVITEMW<br />
{<br />
UINT mask;<br />
int iItem;<br />
int iSubItem;<br />
UINT state;<br />
UINT stateMask;<br />
LPWSTR pszText;<br />
int cchTextMax;<br />
int iImage;<br />
LPARAM lParam;<br />
#if (_WIN32_IE >= 0x0300)<br />
int iIndent;<br />
#endif<br />
} LVITEMW, FAR* LPLVITEMW;<br />
<br />
<br />
#define ListView_InsertItem(hwnd, pitem) \<br />
(int)SNDMSG((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))<br />
<br />
Thaks for reading that stuff
Pain is a weakness living the body
|
|
|
|
|
Hi,
Are you sure that lParam is pointing to a valid LV_ITEM structure?
Cheers,
Andy
|
|
|
|
|
I'm pretty sure because listview is a HWND of list control and its valid
Pain is a weakness living the body
|
|
|
|
|
Check that mask member contains LVIF_TEXT This flag indicates that the pszText member contains a valid address. If the flag is not set, the member could contain any "address".
Also, check that cchTextMax member is not zero. (not really required)
Bikram Singh
|
|
|
|
|
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.
|
|
|
|