|
Thanks for your replay. But I need to get check box event selection message handler not whether check box is checked or not.
|
|
|
|
|
hemlat wrote: Thanks for your replay. But I need to get check box event selection message handler not whether check box is checked or not.
Doesn't matter whether you need it or not - Microsoft don't provide that.
What you do have is LVN_ITEMCHANGING[^] and LVN_ITEMCHANGED[^], which are sent when an item changes in any way - it's up to you to determine if that's because a check box has changed from checked to unchecked or unchecked to checked.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have used both LVN_ITEMCHANGING and LVN_ITEMCHANGED . But these these are sent not only for check box selection but also for another events like adding items to Listctrl.
I have searched for this requirement but I did not get required result. I am not sure whether Microsoft provide this or not. I am new to MFC.
Thanks for your reply. I think I need to change logic of my code dependence on existing event handlers.
|
|
|
|
|
hemlat wrote: I have used both LVN_ITEMCHANGING and LVN_ITEMCHANGED . But these these are sent not only for check box selection but also for another events like adding items to Listctrl.
From MSDN [^]
Parameters
pnmv
Pointer to an NMLISTVIEW structure that identifies the item and specifies which of its attributes are changing.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for your reply.I got it.
|
|
|
|
|
hemlat wrote: I have used both LVN_ITEMCHANGING and LVN_ITEMCHANGED . But these these are sent not only for check box selection but also for another events like adding items to Listctrl.
That's right. So you (YOU) need to add code to those handlers to determine whether or not an items check state has changed. Here's a hint - the checkbox is implemented as an state image overlay - look up LVIS_STATEIMAGEMASK in the list-view item state flags.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for your reply. I got it.
|
|
|
|
|
Hi
I am a new comer in C++. I have an MFC application that using some header files and libraries. I set the 'additional library directories' and 'additional include directories' in project settings. But whenever I want to make an instance of one of those classes I get this error:
error C2259: cannot instantiate abstract class due to the following members: ....
It is wierd as it works in another project same as this one, and there are some other classes in the lib files as this class, but the error doesn't occur in those conditions.
I know the concept of abstract class. Please help me in advanse.
Thanks
|
|
|
|
|
Well, something must be different between your new application and the older ones - otherwise the error wouldn't occur. You need to identify what's different. Start with the error messages. What methods are they telling you aren't implemented? That tells you what to look for in the older projects where those things do work.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
hi all,
I m creating a Win32 smart device project. and using this code for message sending but i have got debug assertion failed in file atlcomcli.h at line 149 and 154.
HRESULT GetSMSMsgStore(const CComPtr<IMAPISession>& spSession, CComPtr<IMsgStore>& spMsgStore)
{
CComPtr<IMAPITable> spTable;
HRESULT hr = spSession->GetMsgStoresTable(MAPI_UNICODE, &spTable);
if (FAILED(hr))
{
AfxMessageBox(IDS_SMS_FAIL_MSGSTORE_TABLES);
return FALSE;
}
while (TRUE)
{
SRowSet* pRowSet = NULL;
hr = spTable->QueryRows(1, 0, &pRowSet);
if (FAILED(hr))
{
AfxMessageBox(IDS_SMS_FAILEDTABLE);
break;
}
if (pRowSet->cRows == 1)
{
ASSERT(pRowSet->aRow[0].lpProps->ulPropTag == PR_ENTRYID);
SBinary& blob = pRowSet->aRow[0].lpProps->Value.bin;
hr = spSession->OpenMsgStore(NULL, blob.cb, (LPENTRYID)blob.lpb, NULL, 0, &spMsgStore);
if (FAILED(hr))
AfxMessageBox(IDS_SMS_FAILED_OPENMSGSTORE);
}
else
{
AfxMessageBox(IDS_SMS_MSGSTORENOTFOUND);
hr = HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
}
FreeProws(pRowSet);
if (FAILED(hr))
{
break;
}
SPropTagArray props;
props.cValues = 1;
props.aulPropTag[0] = PR_DISPLAY_NAME;
ULONG cValues;
SPropValue* pProps = NULL;
hr = spMsgStore->GetProps(&props, MAPI_UNICODE, &cValues, &pProps);
if (FAILED(hr) || cValues != 1)
{
AfxMessageBox(IDS_SMS_FAILED_GETNAME);
break;
}
if (_tcsicmp(pProps[0].Value.lpszW, _T("SMS")) == 0)
{
break;
}
}
if (FAILED(hr))
{
spMsgStore.Release();
}
return hr;
}
HRESULT GetSMSFolder(const CComPtr<IMsgStore>& spMsgStore, CComPtr<IMAPIFolder>& spFolder)
{
SPropTagArray propDefaultFolder;
propDefaultFolder.cValues = 1;
propDefaultFolder.aulPropTag[0] = PR_CE_IPM_DRAFTS_ENTRYID;
ULONG cValues;
LPSPropValue pPropVals;
HRESULT hr = spMsgStore->GetProps (&propDefaultFolder, MAPI_UNICODE, &cValues, &pPropVals);
if (FAILED(hr))
{
AfxMessageBox(IDS_SMS_FOLDERNOTFOUND);
return hr;
}
SBinary& eidDrafts = pPropVals->Value.bin;
hr = spMsgStore->OpenEntry(eidDrafts.cb, (LPENTRYID)eidDrafts.lpb, NULL, MAPI_MODIFY, NULL, (LPUNKNOWN*)&spFolder);
if (FAILED(hr))
{
AfxMessageBox(IDS_SMS_FOLDERNOTOPENED);
}
return hr;
}
HRESULT SendSMSMessage(const CComPtr<IMAPISession>& spSession, LPCTSTR lpszFrom, LPCTSTR lpszTo, LPCTSTR lpszMessage)
{
CComPtr<IMsgStore> spMsgStore;
HRESULT hr = GetSMSMsgStore(spSession, spMsgStore);
if (FAILED(hr))
{
return hr;
}
CComPtr<IMAPIFolder> spFolder;
hr = GetSMSFolder(spMsgStore, spFolder);
if (FAILED(hr))
{
return hr;
}
CComPtr<IMessage> spMessage;
hr = spFolder->CreateMessage(NULL, 0 ,&spMessage);
if (FAILED(hr))
{
AfxMessageBox(IDS_SMS_FAIL_CREATEMESSAGE);
return hr;
}
SPropValue propRecipient[3];
ZeroMemory(&propRecipient, sizeof(propRecipient));
propRecipient[0].ulPropTag = PR_RECIPIENT_TYPE;
propRecipient[0].Value.l = MAPI_TO;
propRecipient[1].ulPropTag = PR_ADDRTYPE;
propRecipient[1].Value.lpszW = _T("SMS");
propRecipient[2].ulPropTag = PR_EMAIL_ADDRESS;
propRecipient[2].Value.lpszW = (LPWSTR)lpszTo;
ADRLIST adrlist;
adrlist.cEntries = 1;
adrlist.aEntries[0].cValues = 3;
adrlist.aEntries[0].rgPropVals = (LPSPropValue)(&propRecipient);
hr = spMessage->ModifyRecipients(MODRECIP_ADD, &adrlist);
if (FAILED(hr))
{
AfxMessageBox(IDS_SMS_FAILED_ADDRECIPIENTS);
return hr;
}
else
;
SPropValue props[4];
ZeroMemory(&props, sizeof(props));
props[0].ulPropTag = PR_SUBJECT;
props[0].Value.lpszW = (LPWSTR)lpszMessage;
props[1].ulPropTag = PR_SENDER_EMAIL_ADDRESS;
props[1].Value.lpszW = (LPWSTR)lpszFrom;
props[2].ulPropTag = PR_MSG_STATUS;
props[2].Value.ul = MSGSTATUS_RECTYPE_SMS;
props[3].ulPropTag = PR_MESSAGE_FLAGS;
props[3].Value.ul = MSGFLAG_FROMME | MSGFLAG_UNSENT;
hr = spMessage->SetProps(sizeof(props) / sizeof(props[0]), (LPSPropValue)&props, NULL);
if (FAILED(hr))
{
AfxMessageBox(IDS_SMS_FAIL_SETPROPS);
return hr;
}
hr = spMessage->SubmitMessage(0);
if (FAILED(hr))
{
AfxMessageBox(IDS_SMS_FAIL_SUBMITMSG);
return hr;
}
return FALSE;
}
i m not able to debug because this error comes in Pocket pc emulator.
if i retry the message send successfully.
please help me to remove thease errors.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
but where in your ocde are the asserts happening. It can be that the objects arent ready to work.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
its comes here
hr = spSession->OpenMsgStore(NULL, blob.cb, (LPENTRYID)blob.lpb, NULL, 0, &spMsgStore);
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Stuart Dootson has written, what I thought about...
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I'm faster than the speed of light, I am
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
here the assert point out the line 149.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: i have got debug assertion failed in file atlcomcli.h at line 149 and 154.
Those both occur in the line you mentioned before (hr = spSession->OpenMsgStore(NULL, blob.cb, (LPENTRYID)blob.lpb, NULL, 0, &spMsgStore); )?
Well, if you're using the same version of atlcomcli.h as me (VS2008), then the first assertion (@line 149) means that spMsgStore already has a value, which you are overwriting. Either Release or Detach the pointer before this line (you probably need Release, I suspect) and the second assertion (@line 154) is because you're calling operator-> on a null smart pointer, which would imply that spSession is null (but then why did the previous call on spSession not fail....)?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i m using this before the specified line
spMsgStore->Release();
but it gives error
error C2248: 'ATL::_NoAddRefReleaseOnCComPtr<T>::Release' : cannot access private member declared in class 'ATL::_NoAddRefReleaseOnCComPtr<T>'
1> with
1> [
1> T=IMsgStore
1> ]
1> C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\atlmfc\include\atlcomcli.h(87) : see declaration of 'ATL::_NoAddRefReleaseOnCComPtr<T>::Release'
1> with
1> [
1> T=IMsgStore
1> ]
so please help me for this.
thanks.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Try spMsgStore.Release
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi All
i have
_variant_t data type variable,which have contain 10 values.Like this
[0,0] = BSTR = 0x0017a66c "Name"
[0,1] = BSTR = 0x0017a6ec "Age"
[0,2] = BSTR = 0x0017a6ec "Class"
...
data is a SAFEARRAY containing BSTR elements.so how can i convert _variant_ to CStringArray?
Plz help me
|
|
|
|
|
See for instance [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
There are useful classes wrapping SAFEARRAYs - see here[^] and here[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
thanks for reply but it's not helpfull for my problem.So plz help me
|
|
|
|
|
Those links are actually helpful, because they give you C++ wrappers for SAFEARRAYs that will simplify the job of converting the SAFEARRAY to some other array of strings.
CComSafeArray<BSTR> safearrayOfBstr(((VARIANT)data).parray);
will wrap the SAFEARRAY contained in the VARIANT.
You can then use the CComSafeArray methods to access the SAFEARRAY data.
This article[^] is very useful, because it gives easier access to 2D SAFEARRAYs, which is what you've got here.
Thing is, it's up to you to do that final step of converting to your CStringArray - but all you need to do is iterate through the relevant elements of the SAFEARRAY, extract the BSTR, convert it to a CString and store that in your CStringArray - not tricky, really!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|